How to run shell script from rc.local
Hello,
Can anybody tell me, How to run shell script at boot time ? Regards, Anshul Pathak |
You've sort of answered your question in the title, so what's not working?
|
Quote:
Actually i have created a java layer and i want to run it on linux at boot time.I have also created the shell script to run that layer and now i want to know what to write in "rc.local" to run my script file at boot time. Regards, Anshul Pathak |
Just add your lines in rc.local (in end ).
eg: /complete/path/to/binary/my_program & HTH. |
You can also install a script in /etc/init.d
The script should handle at least the start, stop and status input commands Then use chkconfig -add <your-script> to set your script to be launched during booting, or just run /etc/init.d/<your-script> start This is how a lot of other services are being started |
Which user do you want this script to run as?
If you just put the /path/to/script into rc.local, it'll be run as root, with no GUI, and you are unlikely to see any error-reporting. This may not be what you want. |
All times are GMT -5. The time now is 10:56 AM. |