[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Inserting Init script



On Mon, Jun 09, 2003 at 10:45:30PM +0200, Marino Fernandez wrote:
> Once I placed a bash script in /etc/init.d, how do I create a link so it is 
> executed during halt (runlevel 0) and reboot (runlevel 6). I tried this:
> 
> update-rc.d <myscriptname> start 99 runlvl 0
> 
> But I get this error:
> 
> expected runlevel [0-9S] (did you forget "." ?)

Just make the link by hand, something like

  ln -s /etc/init.d/foo.sh /etc/rc0.d/S99foo.sh

Change rc0.d as appropriate for the runlevel you're interested in.
Change S to K for script to be run at shutdown rather than startup.
Change the 99 so the script is executed at the right point in the
sequence... they're executed in alphabetical order, as given by ls.

-- 
Pigeon

Be kind to pigeons
Get my GPG key here: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x21C61F7F

Attachment: pgp3b0EOdCV0v.pgp
Description: PGP signature


Reply to: