[25466] in Source-Commits
Re: /svn/athena r25002 -
daemon@ATHENA.MIT.EDU (Benjamin Kaduk)
Sat Mar 5 16:35:07 2011
Date: Sat, 5 Mar 2011 16:34:59 -0500 (EST)
From: Benjamin Kaduk <kaduk@MIT.EDU>
To: Jonathan D Reed <jdreed@MIT.EDU>
cc: source-commits@MIT.EDU
In-Reply-To: <201103050312.p253CYL9009392@drugstore.mit.edu>
Message-ID: <alpine.GSO.1.10.1103051626490.19944@multics.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
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.
> +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.
-Ben