|Free Software at Schools: Installing and Maintaining a Debian-Edu Network; Also Known as Skolelinux|
|Prev||Appendix H. Various "Homemade" Solutions||Next|
It's a bit of a problem when OpenOffice often freezes when ending the program, even after the user has logged out. It seems as if shutting off OpenOffice by clicking on the "x" up in the right corner doesn't really do the job right. And if OpenOffice freezes that way, it may not start again when the next user logs on.
There is a way to ensure that all processes really are finished when a user logs out.
Ensuring that all Processes are Finished
This is the script that does the job. You can call it something like finish.sh:
#!/bin/bash # License: GPL #email@example.com #This script can be saved as /usr/local/bin/finish.sh #remember chmod 755 /usr/local/bin/finish.sh KILL=/usr/bin/pkill # root can do whatever he wants [ -x $KILL ] || exit [ "$1" -a "$1" != "root" ] || exit # first let's be polite $KILL -u $1 #then we wait 5 seconds sleep 5s #before we finally finish them off $KILL -9 -u $1
Place this script in a directory such as /usr/local/bin/
To make sure that this script is run every time the user logs out, use a text editor to add this line
/usr/local/bin/finish.sh $USERto the file /etc/kde2/kdm/Xreset
Remember to make the script executable by running the command
chmod 755 /usr/local/bin/finish.sh
This script will make certain that all processes currently run by a user will really be terminated when he logs out, with the exception of root processes.