On Sunday 23 January 2005 20:43, Andy Teijelo Pérez wrote: > I investigated a little more on this matter and found that when the power > button is pressed, the following line is executed by root: > > dcop --all-sessions --all-users ksmserver ksmserver logout 0 2 0 > I don't know what those three int's mean in the logout method of the > ksmserver dcop interface and the solution could be there. You can look it up here http://developer.kde.org/documentation/library/cvs-api/kdecore/html/classKApplication.html#a9 Actually, maybe it would work by selecting ShutDownMode=ShutdownModeForceNow. I'm not sure what the docs mean by session. > > I thinks this is not a easy problem. If the user clicks the K button on the > panel and then chooses to shutdown, it's fine if an application blocks > waiting for the user to answer whether to save or discard a modified > document. If the root user remotely decides to shutdown the machine, then I think a better solution would be for the document to save all documents as drafts, and restore them upon restart. Never should the application be in a position where it can block a restart (a user pressing cancel is of course another matter). A sysadmin performing a remote shutdown would user the init anyway, and won't be hindered. > no user should be able to cancel this process. > When the user sitting in front of the computer is the only one using the > machine, and he hits the power button of his computer case, it would be > fine to block waiting for a user response to a dialog. But how is the I don't think so. I dislike babysitting my computer. If I press shutdown, I expect the thing to go down. Timed dialogs are fine, but not blocking forever. > system going to know who pressed the power button? The scripts called in > that event run as root. What is the right thing to do? See above. But assuming it's a user is not a bad thing... a sysadmin could just using the init's shutdown. -- regards. Esben ___________________________________________________ . Account management: https://mail.kde.org/mailman/listinfo/kde. Archives: http://lists.kde.org/. More info: http://www.kde.org/faq.html.