Log off script

James Richard Tyrer tyrerj at acm.org
Thu Jan 31 22:28:44 GMT 2008

John F. Moore III wrote:
> OpenSuSE 10.3 32 bit
> KDE 3.5
> I want my system to run one last piece of code at the very end of logging off...
> scp /home/user% user%@server.domain:/~
> ...so that the I complete the loop of a very basic Roaming profile.
> Looking for any information regarding files associated with logon and logoff.
> Would really like KDE to get the LogOn and LogOff commands from my LDAP server. 
> Any Ideas?
First, there is a difference between logging off from KDE and logging 
off from the Xsession.  Be sure you are certain which you want.

KDE now has drop in shell directories although they don't have the 
correct UNIX type names (*.d):


for startup scripts.  If KDEHOME is not set, it will use the default 


for shutdown.

Note the asymmetry.  The startup MUST be a shell script with the 'sh' 
extension and there are only two locations for them (user & global). 
The shutdown can be any executable and they can be in a subdirectory: 
"shutdown" of any of the directories in KDEDIRS.  This also means that 
you must set KDEDIRS to $KDEDIR.  These are still run as user, so if you 
need shutdown actions to run as root use SetUID and appropriate security 
precautions (use the "shutdown" group).

KDE is run by a script called: "startkde" which continues to run after 
the KDE session -- as KDE is shutdown.  So, you can modify this script 
if you wish.  It is in <kdeprefix>/bin.

Then there is the Xsession.  If you use the graphical login, the X 
session is started by a script: "Xsession" which runs as user and does 
not continue to run after KDE is started.  There are also scripts 
"Xstartup" & "Xreset" which run as root before and after the "Xsession" 
script if they are configured in the "kdmrc" file.  These files are in 
<kdeprefix>/share/config/kdm/ and are private for KDM only.  Your distro 
may have moved these.

And finally, there are shell scripts which run as user at login and 
logout: $HOME/.bash_profile & $HOME/.bash_logout (for Bash -- they have 
different names for different shells) IF the "Xsession" script is a 
login script.


This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.

More information about the kde mailing list