pmud & services

Longman, Bill yellowdog-newbie@lists.terrasoftsolutions.com
Mon, 15 Sep 2003 10:24:34 -0700


> Subject: Re: pmud & services

<snip>

> I am no expert, but I think what I am about to say is correct.  If you
> want to turn on a service during startup, you need to tell 
> init to do it.
> One way, is to enter the command you want to run (e.g. 
> /sbin/pmud or maybe
> preferably "/etc/init.d/pmud start") into the file 
> "/etc/rc.d/rc.local".
> This is the last script executed by init when entering 
> runlevels 2 through
> 5.
> 
> The "real" way to do it, is to place a symbolic link into the 
> appropriate
> rc[0-6].d directory.  For example, if you want pmud to start up in
> runlevel 3, type:
> 
> ln -s /etc/init.d/pmud /etc/rc3.d/S40pmud
> 
> where the "S" tells init to run "/etc/init.d/pmud start" (whereas "K"
> would tell init to run "...pmud stop") and the "40" tells 
> init when to run
> it (all the scripts referred to in /etc/rc3.d are run in 
> numerical order).
> 
> To get it to stop pmud nicely before shutting down, you could 
> then enter
> something like:
> 
> ln -s /etc/init.d/sshd /etc/rc0.d/K60pmud
> 
> Of course, if S*pmud is already in the appropriate rc*.d 
> directory, and
> pmud is not starting up, well, then that's a whole different 
> problem...
> Hope that helps.

The chkconfig utility does all this for you. All you need is the script to
exist in /etc/rc.d/init.d and then you can administer it with chkconfig. A
quick for example:

You want pmud to run at all levels:

# chkconfig --level 12345 pmud on

This example assumes there is a script named /etc/rc.d/init.d/pmud

See the chkconfig man page for further details.