Re: kde and ups
Noel Butler via slackware <[email protected]> Mon, 22 Jan 2018 11:59:20 +1000
| Newsgroups | gmane.linux.slackware |
|---|---|
| Message-ID | <[email protected]> |
On 17/01/2018 02:34, [email protected] wrote: > Noel Butler wrote: > >> OK, so who has found the magic cure for KDE to shutdown immediately upon >> a shutdown command? >> >> it seems kde only wants to exit gracefully (or should we say, >> slllllllooooooooowwwwwwwlllyyyyyyy) noprmally I'm OK with this, but on a >> UPS poweroff it needs to exit there and then. >> >> it takes 6 f---ing minutes for KDE 4 to exit, even on a "logout" from >> normal session, if the desktop has been up for a couple of days or more >> just trying to logout from a startx session, even a command line >> shutdown, telinit 0, whatever, takes forever for KDE to go to black >> screen and more forever till it exits back to console to be shutdown. > <snip> > > My experience with Slackware (current) is much better with xfce. > Slackware takes 1 minute to boot, 30 secs to launch xfce, 2 secs > to exit xfce. After "xwmconfig kde", starting kde with startx takes > about 1 minute. After selecting "log out", and after confirming this > with a second log out dialog box, KDE exits in about 30 seconds. > > Could it be KDE is hanging on a confirmation dialog that no user > will ever see, until some lengthy timeout expires? You might > try setting your UPS to shutdown KDE using: > > qdbus org.kde.ksmserver /KSMServer logout <confirm> <type> <mode> > > <confirm> := 0 "Don't confirm, shutdown without asking" > > <type> := 0 "Only log out of KDE", > := 1 "Log out and halt the machine" > > <mode> := 0 "Sched shutdown after all sesions exit" > := 2 "Force shutdown now" > > (The constants are defined in /usr/include/kworkspace/kworkspace.h). > > Possibly you'd want to issue the shutdown in two steps, first > attempt to shutdown gracefully with: > > qdbus org.kde.ksmserver /KSMServer logout 0 0 0 > > Then after a maximum of perhaps 60 seconds elapsed, if the machine > hasn't shut down, issue: > > qdbus org.kde.ksmserver /KSMServer logout 0 1 2 > > After another minute or so, if the machine still hasn't > halted, force a shutdown with /sbin/shutdown. > > Best luck, Thanks for the pointers, though what I ended up needing was: SHUTDOWNCMD "/sbin/shutdown -P -h now ; sudo -u noel qdbus org.kde.ksmserver /KSMServer logout 0 2 2" shutdown was always executed previously, but was never able to force X to exit, sitting there for 5/6 minutes before X eventually exited, then shutting down, with the UPS only providing about 2 or so minutes power after lowbatt-shutdown issue, this only caused FS corruptions, I kept shutdown first since desktop might not always be in X 'sudo as user' was needed, 'nut' running as root rightly got qdbus connect errors, since root was not running X :) 0 1 2 just reboots, but 0 2 2 halts. After 3 days system is fully powered off now after about 40 seconds. I dont want to kill the battery too fast given the number if times its been onbatt and exhausted in past few weeks, so will see how it goes after a few weeks of uptime. -- Kind Regards, Noel Butler This Email, including any attachments, may contain legally privileged information, therefore remains confidential and subject to copyright protected under international law. You may not disseminate, discuss, or reveal, any part, to anyone, without the authors express written authority to do so. If you are not the intended recipient, please notify the sender then delete all copies of this message including attachments, immediately. Confidentiality, copyright, and legal privilege are not waived or lost by reason of the mistaken delivery of this message. Only PDF [1] and ODF [2] documents accepted, please do not send proprietary formatted documents Links: ------ [1] http://www.adobe.com/ [2] http://en.wikipedia.org/wiki/OpenDocument -- slackware mailing list [email protected] https://mailman.lug.org.uk/mailman/listinfo/slackware