On Linux, exists an rc.local matching for shutdown?

I've obtained a couple of commands that I run in rc.local so they are run last in the startup series. I would love to recognize if there is a comparable center for ruin the outcomes of those commands at shutdown, like an rc.shutdown. Preferably, it would certainly be run prior to any one of the various other /etc/init.d manuscripts.

0
2019-05-05 02:24:45
Source Share
Answers: 4

In Gentoo the "neighborhood" manuscript does specifically what you request for : It runs particular customer defined commands upon 'start' and also an additional set of commands upon 'stop'.

0
2019-05-12 00:56:20
Source

If you have startup, you can capture the shutdown occasion and also run a manuscript when it is captured.

0
2019-05-08 09:06:39
Source

Not actually (at the very least, to my expertise).

If you've obtained SystemV design init manuscripts, you can create something along the lines of /etc/rc6.K00scriptname and also /etc/rc0.d/K00scriptname, which need to get implemented before any one of the various other manuscripts therein.

0
2019-05-08 04:47:12
Source

ArchLinux does have a /etc/rc.local.shutdown apply for this. I'm not exactly sure concerning various other distros

0
2019-05-08 01:25:18
Source