There's a nice Python script for the job at
linuxquestions.org written by Seamus Phelan. I've tested it, found a few problems and fixed them.
During my googling I've found a number of interesting pages that helped me understand the logout process:
- Description of the signals Gnome sends to the listening clients
- The execution of the script omits a warning on some versions of GTK:
/home/demo/bin/gnome-logout-daemon.py:34: Warning: g_set_prgname() called multiple times
prog = gnome.init("gnome-logout-daemon", "1.0", gnome.libgnome_module_info_get(), sys.argv, [])
This is due to a bug in glib2.0 which appeared as an unexpected side-effect of a bugfix. This happens sometimes and fortunately the problem has already been resolved in the latest version of the GTK library (the upcoming version of the libglib2.0-0 package in Ubuntu will already have the fix).
I've also learned about the sequence of events sent by Gnome to the clients. It's fairly simple:
- save-yourself (phase = 1)
- save-complete
- save-yourself (phase = 2)
- save-complete
- die
Unfortunately the
save-yourself event's
phase parameter has a buggy implementation. In both cases of the
save-yourself event the
phase parameter equals "1" ... while the
documentation clearly states that it should equal "2" in the second phase.
Recent comments
18 hours 53 min ago
19 hours 11 min ago
3 days 8 min ago
1 week 6 hours ago
1 week 11 hours ago
1 week 1 day ago
1 week 1 day ago
1 week 2 days ago
1 week 4 days ago
1 week 6 days ago