Beta package gnome-watchdog - take care that a faulty gnome user session gets cleaned up

Philipp Hanselmann philipp at schoolnet.na
Wed Oct 3 21:14:46 BST 2007


Hi

We also have been struggeling with faulty gnome user session which 
doesn't get cleaned up, during logout. Always we had a lots of user 
zombie processes running on the server.

Now I programmed the gnome-watchdog scripts which solve the issues for 
us. Your welcome to test this beta packages, which is upto know working 
with Feisty.

To install the package do the following steps:

1.) install gtkdialog
apt-get install gtkdialog

2.) download the package
http://www.morokeni.ch/edubuntu/gnome-watchdog_0.9_i386.deb

3.) and install the package like this:
dpkg -i gnome-watchdog_0.9_i386.deb


More infos about the scripts please read below ...

I hope they are useful for you...
Philipp

-------------------------

gnome-watchdog - cleans up gnome user session of Edubuntu and checks if 
a user is logged in already.
----------------------------------------------------------------------------------------------------

It happens with Edubuntu that user processes continue to live, even 
though the user
isn't logged in anymore. That's not a really nice thing, because these 
zombie processes
running in the background consume memory and cpu from the server. Now 
the question is
how can we get rid of these processes?

Let us have a look at the current situation:
There are different use cases, how these user zombie processes are created:

(1) Users are lazy. Instead of logging out properly they just press the 
power button (hard reset)
(2) The user is using CTRL-ALT-BACKSPACE (killing the X11 session) to 
log out.
(3) User is logged out normally, but some faulty program doesn't get 
terminated.
(4) A program is freezing the thin client completely, which forces the 
user to reboot
the thin client.

(5) In some cases It can even be that these remaining processes prevent 
a user login with
the same user.

These scripts take care that a faulty gnome user session gets cleaned 
up, when a user isn't
logged in anymore ...

How does it work:

During a gnome login process a watchdog script (called gnome-watchdog) 
starts. The special
thing about this script is, that it starts with the command nohup. 
Starting like that the
gnome-watchdog script is ignoring any hangup signals.
Which means this script survives even if the user is logging out in the 
normal way (3) or
unexpectedly (1,2,4+5).
Basically the script is waiting in a loop, until the process gnome-panel 
get terminated.
In case this is happening, he waits a certain period to be sure that the 
process doesn't get
restarted by his parent process. If this isn't happening the script 
assumes that the user
isn't logged in anymore.
Now the cleaning process takes place. The scripts checks if any user 
process under this user id
are still running. If yes, he kill all these user processes.

Based of some testing with these method you should get 99% of the cases 
2 and 3 solved.
Unfortunately if the user is doing a hard reset (1), it happens that 
almost all process including
the gnome-panel process is running as zombie processes.
Sometimes it happens, that after a while the gnome-panel get terminated, 
which will also led
that remaining process get killed by the watchdog script.

But when the process gnome-panel of this user is surviving, it can 
happen that the same user
isn't able to login anymore (5).

Now these script brings for that also a solution, but it must be 
manually activated.
For that just create the file like this:
  touch /etc/check_previous_login

When this feature is activated, the script gnome-watchdog-start will 
check during a user login,
if there is already a gnome-panel is running.
If yes the user will be notified by a message box, that a previous 
session is still running. The
user has now the option to kill this previous session, before he logs in.

May is imported to know also these facts:
- All actions from the scripts get logged, to the syslog daemon 
(/var/log/messages).
- The script doesn't get executed for user root, schoolnet and teacher 
(see script).
- The script only get started when you you choose gnome as session and 
when you doing
a thin client login.

Please note these scripts are only tested for about two weeks. Up to now 
we had good
experiences with them.
Anyway be warned that may they are still faulty somehow. So if you use 
them and your system and
your server starting to kill users without a notice, may is better to 
remove them before doing
further troubleshooting.

philipp at schoolnet.na

-- 
SchoolNet NA - Youth Empowerment through Information and Communication Technology

SchoolNet Namibia provides sustainable, low cost technology solutions and internet access, as well as technical support, training services and rich educational content to schools, community-based educational organisations, and educational practitioners throughout Namibia.

www.schoolnet.na






More information about the edubuntu-users mailing list