-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 20 June 2003 04:07 am, Devrim GUNDUZ wrote:
> Hi,
>
> On Fri, 20 Jun 2003, cem caglar wrote:
> >     I'm a newbie and I need to run my program everytime the linux
> > starts up. The program is mine, so it doesn't exist on the list of
> > NTSYSV. Can I add it to the list or run it another way?
>
> Let's assume that your program lies at /usr/sbin/myprogram
>
> Edit /etc/rc.local and write
> /usr/sbin/myprogram &

This is probably the easiest, I agree.

> Then your program will run everytime linux boots.
>
> The other solution(for ntsysv= is a bit complicated for a newbie. You
> should place the startup script in  /etc/init.d and create symbolic
> links ro /etc/rcX.d, where X stands for the runlevel.

If the correct comments are added to the startup script, putting the 
script into /etc/init.d/ and running:
'/sbin/chkconfig --add script_name'
'/sbin/chkconfig script_name on'

is all that should be required. The links are managed by chkconfig, and 
there is no reason to attempt managing them by hand.

The required comments needed in the script are:
# chkconfig: 2345 11 89
# description: starts my script

2345 denotes runlevels where the script should be activated.
11 is the boot time start order.
89 is the order of shut down.

Chkconfig will create and manage the K89myscript and S11myscript links in 
/etc/rc*.d

You may want to add functions to the script for 'start', 'stop', 
'restart', etc. Have a look at an existing script in /etc/init.d for 
ideas on how make the modifications.

- -- 
- -Michael

pgp key:  http://www.tuxfan.homeip.net:8080/gpgkey.txt
Red Hat Linux 7.{2,3}|8.0 in 8M of RAM: http://www.rule-project.org/
- --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+8urGn/07WoAb/SsRAtpLAJ9Z8sdMRyt/5iYlnfQcYryz8SRYjQCgoOVH
ccp7q/eWoq//pEy2Pa+CMQU=
=gGwv
-----END PGP SIGNATURE-----


-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list

Reply via email to