Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Adding script to startup and shutdown procedure (Debian Etch)

40 views
Skip to first unread message

explos...@gmail.com

unread,
Dec 2, 2008, 11:13:16 PM12/2/08
to
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.

Can anyone point me in the right direction?

Many Thanks,
Tom

John Taylor

unread,
Dec 3, 2008, 3:54:08 AM12/3/08
to
On Tue, 02 Dec 2008 20:13:16 -0800, explosive.tom wrote:

> 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


0 new messages