0

I have a Linux script which I require to get executed just before the host is going down.

Where do I need to place the file in order to work?

1
  • 4
    It depends on your init; systemd/sysvinit/runit/upstart... Jan 3, 2017 at 11:08

1 Answer 1

0

In Ubuntu/CentOS:

Keep your script in /etc/init.d/ and create a symbolic link in /etc/rc0.d started by K50 (K for kill, 50 for execution priority)

ln -s /etc/init.d/your_script.sh /etc/rc0.d/K01your_script

You must log in to answer this question.

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