Are all scripts in /etc/init.d automatically executed at startup?
Are all scripts in /etc/init.d automatically executed at startup?
Or do I have to saved them there AND to activate them explicitely? Are these scripts executed before starting other possible services (ssh, mailer, ...) or are they executed at the end of all startup processing? Peter |
Hi,
Quote:
Quote:
to /etc/rcN.d/ (where N is a positive intiger) prepended with and S or a K and a two digit number. Scripts starting with S(K) will be started(sopped) at run level N, There should also be a /etc/rcS.d/, these scripts are run at startup regardless of the runlevel. Quote:
Please note that this is just a very rough overview and that there is plenty of detailed information available on the web and most probably in the man pages on your system. Also please note that these days there are other init systems such as upstart and systemd. Cheers, Evo2. |
They are not automatically executed. You have to choose which ones run automatically in which run level. In centos/redhat/fedora/(open)suse you do this via the chkconfig command:
Code:
chkconfig --list Code:
man chkconfig the above will get you the chkconfig documentation. |
Quote:
Ok. thank you. Do these services have to be binary programs or can I specify a perl/shells script as well? Can I use user defined scripts here at all? |
Most of the files in /etc/init.d are actually shell scripts.
Unless you are installing a daemon from source you should avoid creating anything in /etc/init.d. Instead you should add your custom commands to /etc/rc.local (on redhat derived distros). Anyway you still haven't told us what distribution you are using. You can find out by running the following command: Code:
cat /etc/issue |
Quote:
CentOS and Ubuntu |
All times are GMT -5. The time now is 03:28 PM. |