System-wide logout script?

Jaap Winius jwinius at umrk.nl
Thu Sep 8 02:15:53 CEST 2011


Quoting Chris G <cl at isbd.net>:

> I asked for something like this a while ago and the answer was that
> there isn't such a thing.

Well, then perhaps I've found a workaround. Since Xfce is so  
impoverished in this respect, use the display manager instead. If  
you're like me and use gdm, you can add your logout code to  
/etc/gdm/PostSession/Default. Otherwise, see:

http://superuser.com/questions/65460/create-a-logoff-script-task-for-linux

Unfortunately this gdm script is executed as root, so additional  
effort is needed to discover the identity of the previously logged in  
user. For example:

ID=`tac /var/log/auth.log |grep -m1 pam_unix\(gdm:session\) |awk  
'{print $11}'`

No doubt there is a more elegant solution, but you get the idea.

Cheers,

Jaap


More information about the Xfce mailing list