On Mon, Aug 20, 2012 at 12:44:32PM +0200, Josselin Mouette wrote: > Le samedi 11 août 2012 à 15:38 -0400, Chris Knadle a écrit : > > systemd may seem better in /most/ cases because it does have some nice > > features, but I don't think it's better in *all* cases. systemd doesn't allow > > shutdown/reboot from within KDE4 > > In the beginning, ConsoleKit didn’t allow shutdown/reboot from within > KDE4. > > Maybe one of the KDE maintainers will remind us how many lines did the > patch measure, but ISTR it’s less than 10. The version in wheezy is crawling with race conditions that make shutdown/reboot attempts randomly fail, seemingly on any desktop environment (I reproduced this on Gnome 3, XFCE, Mate, didn't try KDE). The fail message claims shutdown is not allowed because multiple users are logged in. I investigated the problem, and it turns out it would be pretty hard to fix, certainly not in a matter of 10 lines. Currently, a shutdown/reboot sequence: * sends signals to your processes in the session (tty ones get SIGHUP) * sends a request over dbus to consolekit * if any process in the session is setuid/setgid and still alive, consolekit responds with a failure * a window asking for root's password is spawned; cancelling it will spawn ANOTHER message box claiming shutdown is not allowed (which was already mentioned in the root password question) I see no obvious way to fix this -- merely waiting a bit longer is not going to help as there's no bound on how long processes take to die on a sufficiently loaded system[1]. And you can't tell a process that merely takes some time to die from one like wget that handles the signal and continues. One idea would be to display the authentication box but keep repeatedly requesting shutdown while the box is up. [1]. Especially ex-Windows users assume that a on a barely responsive system, a shutdown attempt is more likely to succeed than trying to find and kill the offender; in a GUI and for non-technical users that's not entirely without merit. And then, the shutdown attempt will be hit by this race. -- Copyright and patents were never about promoting culture and innovations; from the very start they were legalized bribes to give the king some income and to let businesses get rid of competition. For some history, please read https://en.wikipedia.org/wiki/Statute_of_Monopolies_1623
Attachment:
signature.asc
Description: Digital signature