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

Re: adding scripts to /etc/init.d ?



hello gale...

2002-07-18/11h, when Gale Stafford wrote:
> I want debian to start pump when it boots up, so that I dont have to manually type "pump -i eth0" every time I boot my computer. I read this morning that I need to add a script to /etc/init.d for pump. Also I understand that I would need to create a link from that script to a file in my /etc/rc3.d/ directory, since I boot into run level 3.

the simplest version would be to create a file /etc/init.d/pump which 
contains the following

#! /bin/sh
/sbin/pump --interface=eth0


then you should cd to /etc/rc3.d and create a link via:
ln -s ../init.d/pump S99pump


well, and that is it, basically. if you decrease the number behind the
"S", e.g. S20pump, it will be started earlier in the boot process. this is 
perhaps wanted if you have other services which rely on a working network.
you do not have to stop the "pump service" at shutdown, since it is not
really a service or daemon.

but if you have something special in mind with starting and stopping the
whole pump-affair while running the system, you should take a look at the 
files in /etc/init.d to get an idea on how to make full-blown
init-script.


> Are there any good reading materials on the net that would help me write a script to start/shutdown pump? I'm new to script-writing.

well, script-writing depends on the shell you are using. i guess, your
shell is bash, so try the howto from the package doc-linux-text (apt-get
install doc-linux-text) and read it via:
zless /usr/doc/HOWTO/en-txt/Bash-Prog-Intro-HOWTO.gz


hth,
 myster sen

Attachment: pgpcFTGXB6MVN.pgp
Description: PGP signature


Reply to: