I have several scripts in $HOME/.config/plasma-workspace/shutdown to do some cleanup and prevent data corruption of my home file system (encrypted) but those scripts are only executed when I log out of the session. They are not executed when doing a full shutdown or reboot. Reproducible: Always Steps to Reproduce: 1. Reboot or shutdown 2. 3. Actual Results: Nothing executed in $HOME/.config/plasma-workspace/shutdown Expected Results: All scripts in $HOME/.config/plasma-workspace/shutdown should be executed and finished before completing the shutdown/reboot As mentioned, I use an encrypted home, and if some processes are left running, infamously being kactivitymanagerd, I end up with corrupted files because of dirty unmounts. Besides scripts to fix that I have some other things to run before shutdown. If this should be handled by systemd, any suggestion on how to do that is appreciated, I did try several ways with systemd to no avail
ksmserver issue?
Shutdown scripts are done by startkde after ksmserver quits. Which never happens because we've told systemd to shutdown. Older systems asked the DM to close us then they did the shutting down (because you need something that runs as root to do it) Obvious fix is to just move shutdown scripts into ksmserver before we call KDisplayManager::shutdown (which weirdly includes logout) and remove code from startkde. I'll do that tomorrow for 5.5.1 A more awesome (but less portable) method is to make ksmserver have a systemd delay inhibitor on shutdown; but then we'd need a separate path for logout...so maybe not worth it
Would be great if this gets fixed! There is probably no hope to see this backported to older versions? Otherwise it will probably take another year before this fix would reach opensuse :(
Git commit 1dc7f11692a4096b9815ae24f7be9cec10f8f7a5 by David Edmundson. Committed on 13/12/2015 at 16:29. Pushed by davidedmundson into branch 'Plasma/5.5'. Move shutdown scripts into ksmserver cleanup Shutdown scripts are done by startkde after ksmserver quits. Which never happens because we've told systemd to shutdown. Old systems worked because they used to communicate with the display manager which then closed us before shutting down, this is no longer the case. This moves handling the shutdown scripts into ksmserver (which already handles startup scripts) and runs them before asking logind to shutdown. REVIEW: 126268 M +27 -0 ksmserver/server.cpp M +2 -0 ksmserver/server.h M +0 -9 startkde/startkde.cmake M +0 -9 startkde/startplasma.cmake http://commits.kde.org/plasma-workspace/1dc7f11692a4096b9815ae24f7be9cec10f8f7a5
*** Bug 356898 has been marked as a duplicate of this bug. ***