How to Make Auto Start Bash Script After Reboot on CentOS 6
Several ways to make a change are necessary, now in my article this time I will share about how to change the old way to turn on a service manually and replace it with a simpler way after the system turns off, namely Auto start service which is created using a bash script.
How to Make Auto Start Bash Script After Reboot on CentOS 6 |
Preparation
What you need to prepare is a bash script that will be auto-started after rebooting. You can also make even simple or complicated commands that you want to run.
Configure
just go ahead because I already have a bash script and put it in "/home/kitsake/bin/startAll". we can directly call it in rc.local.
# vi /etc/rc.d/rc.local
.... echo "The computer booted up at" `date` >> /home/kitsake/log_rc.out su - kitsake -c /home/kitsake/bin/startAll >> /home/kitsake/log_rc.out
Don't forget to save and close
Trying
To do the testing, you only need to reboot the system and see that the service you ordered in the bash script is running perfectly or you can also look at the log output that was created earlier.
# reboot # ps -eaf|grep hdlxim
See the service that is made auto start |
Post a Comment for "How to Make Auto Start Bash Script After Reboot on CentOS 6"