[wplug] rc.local

billings at negate.org billings at negate.org
Wed May 28 10:58:50 EDT 2003


On Wed, 2003-05-28 at 10:40, Chris wrote:

> 
> Yep, it produces that plus this.
> 
> -rwxr-xr-x      1 root    root            437 May 28 09:59 rc.d/rc.local

That means it's never run.  SysV-style init runs scripts in the
/etc/rc#.d directories, where '#' is the runlevel.  For example, on my
redhat 7.1 system:
lrwxrwxrwx    1 root     root           17 Nov  5  2001
/etc/rc0.d/K05anacron -> ../init.d/anacron*
lrwxrwxrwx    1 root     root           17 Nov  5  2001
/etc/rc1.d/K05anacron -> ../init.d/anacron*
lrwxrwxrwx    1 root     root           17 Nov  5  2001
/etc/rc2.d/S95anacron -> ../init.d/anacron*
lrwxrwxrwx    1 root     root           17 Nov  5  2001
/etc/rc3.d/S95anacron -> ../init.d/anacron*
lrwxrwxrwx    1 root     root           17 Nov  5  2001
/etc/rc4.d/S95anacron -> ../init.d/anacron*
lrwxrwxrwx    1 root     root           17 Nov  5  2001
/etc/rc5.d/S95anacron -> ../init.d/anacron*
lrwxrwxrwx    1 root     root           17 Nov  5  2001
/etc/rc6.d/K05anacron -> ../init.d/anacron*

the "K05" means that it's priority for being shut down (K) is 05, and
the "S95" means that it's priority for being started is 95.  The
priority is a zero-spaced number between 00 and 99.  Since your script
has no such link in any of the runlevels, it is never run.


> This might be related to the same problem but when I reboot apache doesn't
> restart either. There is a script in rc5.d called S85httpd that I am
> assuming should start it but it doesn't

Are you running at runlevel 5?  If not, then you might want to put a
link in the appropriate runlevel.

Of course, redhat has a couple useful tools for handling this kind of
behavior.  'chkconfig' is the one I use most commonly.  The init scripts
have to have chkconfig support, but it makes it very easy to add and
remove the services.  Simply:

chkconfig --add <servicename, like httpd>

or, if you want to be very specific:

chkconfig --level <levels, like 345> <servicename> <on|off|reset>

Of course, I suggest reading the man page.

-- 
Jonathan S Billings <billings at negate.org>
TSFNKP



More information about the wplug mailing list