3

I would like to run a script file when the system is called for shutdown/ reboot from 'reboot' and 'shutdown' commands. And if possible, also hard shutdowns like 'init 0' or 'poweroff'. How would I go about doing that? A config file or command would be nice. I use systemd instead of initscripts.

1 Answer 1

0

Just copy / link the script into your /etc/init.d/rc0.d (HALT) and /etc/init.d/rc6.d (reboot) directories, and make sure it's name is prefixed with: "K20"

FYI: http://www.linux.com/news/enterprise/systems-management/8116-an-introduction-to-services-runlevels-and-rcd-scripts

3

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .