Link to home
Start Free TrialLog in
Avatar of TheMaximumWeasel
TheMaximumWeasel

asked on

running a bash script upon boot

how would I go about running a bash script when centos boots?

Max
ASKER CERTIFIED SOLUTION
Avatar of JanSchotsmans
JanSchotsmans
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of yuzh
yuzh

You can run the script via /etc/rc.d/rc.local file
eg: inserver the following line to the file:
/path-to/myscript

please read:
http://www.linuxtopia.org/online_books/centos_linux_guides/centos_linux_reference_guide/s1-boot-init-shutdown-process.html

or put the escript in /etc/rc2.d  or /etc/rc3.d depends at which run level you want to start the script.
You need to name the script looks like
S99myscript

must starting with a up case S follow by a number then whatever name.