[25467] in Source-Commits
Re: /svn/athena r25002 - trunk/debathena/config/cluster-login-config/debian
daemon@ATHENA.MIT.EDU (Jonathan Reed)
Sat Mar 5 16:40:31 2011
Mime-Version: 1.0 (Apple Message framework v1082)
Content-Type: text/plain; charset=us-ascii
From: Jonathan Reed <jdreed@MIT.EDU>
In-Reply-To: <alpine.GSO.1.10.1103051626490.19944@multics.mit.edu>
Date: Sat, 5 Mar 2011 16:40:23 -0500
Cc: source-commits@MIT.EDU
Message-Id: <C3E70ABF-B662-4853-8D20-20DC818C4AFF@MIT.EDU>
To: Benjamin Kaduk <kaduk@MIT.EDU>
Content-Transfer-Encoding: 8bit
On Mar 5, 2011, at 4:34 PM, Benjamin Kaduk wrote:
> On Fri, 4 Mar 2011, Jonathan D Reed wrote:
>
>> Added: trunk/debathena/config/cluster-login-config/debian/screensaver_logout.sh
>> ===================================================================
>> --- trunk/debathena/config/cluster-login-config/debian/screensaver_logout.sh (rev 0)
>> +++ trunk/debathena/config/cluster-login-config/debian/screensaver_logout.sh 2011-03-05 03:12:34 UTC (rev 25002)
>> @@ -0,0 +1,27 @@
>> +#!/bin/sh
>> +#
>> +# A more ... insistent ... logout command for gnome-screensaver
>> +#
>> +
>> +PATH=/usr/bin:/bin:$PATH
>> +
>> +if [ "$(machtype -L)" != "debathena-cluster" ]; then
>> + gnome-session-save --force-logout
>> + exit 0
>> +fi
>> +
>> +cell=athena.mit.edu
>> +afspath=$HOME
>> +if echo $HOME | grep -q ^/mit; then
>> + # Shouldn't happen with std dotfiles
>> + afspath=$(readlink $HOME)
>> +fi
>> +if echo $afspath | grep -q ^/afs; then
>> + cell=$(echo $afspath | cut -d/ -f 3)
>
> This feels a little bit awkward. I think that logically, we should only be setting cell if $HOME is in /afs, and only doing the tokens check if cell is set. If some clever user decides to set $HOME to something else, well, then they hit the pkill branch.
If HOME is not in AFS, you don't get to log into the cluster machine. Setting HOME to something else is unsupported.
This check is here for the following case: your homedir is in a foreign cell, and you have tokens for that cell, but you let your Athena tokens expire because oyu don't need them. In that case, we still want to do a graceful logout.
>
>> +fi
>> +if tokens | fgrep -q $cell; then
>> + gnome-session-save --force-logout
>> +else
>> + pkill schroot
>> +fi
>> +
>
> No return value for this branch? We 'exit 0' after the gnome-session save in the non-cluster case.
That case should never happen, because this code only gets installed on cluster machines. The metapackage check was there purely to avoid wankery about the hypothetical case in which someone removes -cluster, but somehow the package ends up broken. I'm happy to remove it, because again, cluster-login-config should never end up on not-cluster.
-Jon