4
votes
0answers
92 views

Execute code on shutdown on Fedora 19

I need to catch any OS shut down and execute some actions before letting the OS be shutted down. I'm using Fedora 19 and C++. I'm able to catch a shutdown signal given by the console with the ...
1
vote
1answer
100 views

How to postpone shutdown with systemd?

I run a desktop computer, which typically is shut down for the nights and often also during the day, when not in use or left unattended. I usually shut it down from GUI (KDE 4.10), sometimes - from ...
7
votes
1answer
714 views

What's the right way to execute a script before system shutdown (systemd)?

I wrote a script that suspends all my VirtualBox machines, and put a line in /etc/rc.local.shutdown, but it doesn't seem to work, su - XX -c /XX When I'm booting the next time, VirtualBox tells me ...
11
votes
3answers
613 views

Eject CD on shutdown

OK, so I have a simple problem: I have a live CD, and I want the CD to eject when the computer is rebooted or halted. Executing /usr/bin/eject -m makes the CD eject just fine... trouble is, as you ...
8
votes
3answers
5k views

How to run a script with systemd right before shutdown?

What do I need to put in the [install] section, so that systemd runs /home/me/so.pl right before shutdown and also before /proc/self/net/dev gets destroyed? [Unit] Description=Log Traffic [Service] ...
7
votes
1answer
899 views

How to shutdown with consolekit without sysvinit (but with systemd)

I have systemd (and no sysvinit) installed on a Arch Linux box. However, I cannot shutdown/reboot with consolekit (dbus interface). # systemctl {shutdown,reboot} work just fine, so I guess it's ...