Main Menu

Search

Showing posts with label Linker Article Linux Services Startup Shutdown. Show all posts
Showing posts with label Linker Article Linux Services Startup Shutdown. Show all posts

LINUX: How To Make Shell Script Execute During Startup When Linux Server/Host Is Rebooted ? (rc3.d initscripts) (How To Doc)

In order to make shell script execute during startup when Linux Server is rebooted, we will have to add the shell script to rc3.d initscripts  (run level 3). Below are steps to follow:
1) Copy the shell script inside the /etc/init.d directory on Linux Host.
2) On Linux, execute below commands and create symbolic link.
# cd /etc/rc3.d


# ln -s /etc/init.d/<scriptname> /etc/rc3.d/S99<scriptname>

With above commands the start order of the script after reboot will be in 99th place. You can change the number 99 to the number you want to initiate the script during reboot. Usually it is best practive to have all the user scripts execute after the initialization OS level scripts.

3) Reboot the Linux machine.
Products to which Article Applies

All Linux Operating Systems.


Additional References

https://www.heatware.net/linux-unix/run-a-script-on-linux-startup-in-2-simple-steps/

LINUX: How To Check the Status of All the Services In Linux?

Below command can be used to check the status of all the services on Linux
service --status-all

Below is example snippet (partial output) of above command for reference.
# service --status-all
Checking for ibacm service [  OK  ]
Host Administrated vNics: none.
netconsole module not loaded
Configured devices:
lo bond0 bond1 bond2 bond3 bond4 eth646_1.318 eth1286_2.318 eth0 eth0.800b eth0.8004 eth0.8006 eth1 eth1.800b eth1.8004 eth1.8006
Currently active devices:


Products to which Article Applies


All Linux environments

Additional References

https://www.cyberciti.biz/faq/check-running-services-in-rhel-redhat-fedora-centoslinux/