Quote:
Originally Posted by moisespedro
What is the difference between using:
chmod +x /etc/rc.d/rc.local
Or:
/etc/rc.d/rc.local enable
?
|
the first command doesn't do anything because /etc/rc.d/rc.local (the last script to be executed at boot) is already executable.
the second just executes rc.local: it doesn't know about an "enable" parameter because by default it's empty, it doesn't contain something (commands, function, etc.) to execute when passed that string.
if you want to execute an executable /etc/rc.d/rc.whatever at boot you have to add an if..then like this inside /etc/rc.d/rc.local
Code:
# Starting the whatever daemon
if [ -x /etc/rc.d/rc.whatever ]; then
/etc/rc.d/rc.whatever start
fi
(obviously the rc.whatever must be an init script - for an example you can see
rc.clamav)
ad if you want the "whatever" daemon to stop at shutdown, you have to add something similar to /etc/rc.d/rc.local_shutdown
Code:
# Stopping the whatever daemon
if [ -x /etc/rc.d/rc.whatever ]; then
/etc/rc.d/rc.whatever stop
fi