I am trying to integrate a small script into both the startup and
shutdown procedure (they are workarounds to allow my UPS to shutdown
and reboot my server during a power failure).
The guide (http://www.mscs.dal.ca/~selinger/ups/belkin-universal-
ups.html#workaround) indicates that the startup script needs to be
included before the disks are made Read/Write or any disk integrity
checks are carried out and the shutdown script needs to be included
after the disks are made Read-Only.
Can anyone point me in the right direction?
Many Thanks,
Tom
> Hi,
>
> I am trying to integrate a small script into both the startup and
> shutdown procedure (they are workarounds to allow my UPS to shutdown and
> reboot my server during a power failure).
>
> The guide (http://www.mscs.dal.ca/~selinger/ups/belkin-universal-
> ups.html#workaround) indicates that the startup script needs to be
> included before the disks are made Read/Write or any disk integrity
> checks are carried out and the shutdown script needs to be included
> after the disks are made Read-Only.
>
Assuming that Debian is the same as Ubuntu (which I have)
You need to create a script in /etc/init.d
(see other scripts there for some examples)
You need to implement at least the start and stop arguments:
/etc/init.d/yourscript start
/etc/init.d/yourscript stop
Then you need to create some symbolic links in the /etc/rc*.d directories
to point to your script.
There is an rcX.d for each run level
You need to call them either SXXname or KXXname
The S links will be called with the start parameter when the runlevel is
entered, and the K links when the run level is exited.
They are run in numerical order, so S01name will get run before
S02anothername
Looks like (un)mounting is done in rc0.d,rc6.d and rcS.d
JohhT