I need to put a startup script to my CentOS6 server.
I see that I need a script that contains start-stop cases. But I have a problem to make it and neither how to put this script to startup.
Anyone can say me how can I add it?
The script must run a simply command that run a jar file:
java -jar FileName.jar
The simplest way would be to add your command to the file
/etc/rc.d/rc.local
Commands in the above file are run at startup (as root). Note that if you do this, your command will NOT respond to the usual service start/ stop commands.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With