Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Centos 6 startup script [closed]

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
like image 611
Univers3 Avatar asked Dec 20 '22 09:12

Univers3


1 Answers

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.

like image 83
chue x Avatar answered Jan 13 '23 12:01

chue x