Am 28.03.2015 um 18:29 schrieb Matthias Bodenbinder: > Hi, > > how can I temporarily disable shutdown or reboot? > > My use case is the following: I create a file /tmp/NO_SHUTDOWN. If that file > exists, a shutdown or reboot should not be possible. > I have molly-guard installed and a script in /etc/molly-guard/run.d/ tests > the existence of that file and prevents shutdown/reboot on the commandline. > > But a user in KDE can still do reboot/shutdown from either KDE or even KDM. > How can I prevent that with a file /tmp/NO_SHUTDOWN.
If you are using jessie and systemd, you can use systemd-inhibit [1]. You can run something like systemd-inhibit --what=shutdown --mode=block /bin/sleep 3600 to block shutdown for 1h. Cheers, Michael [1] http://www.freedesktop.org/software/systemd/man/systemd-inhibit.html -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?
signature.asc
Description: OpenPGP digital signature