LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   trying to run "java -jar start.jar" at boot Centos6.4 (http://www.linuxquestions.org/questions/linux-newbie-8/trying-to-run-java-jar-start-jar-at-boot-centos6-4-a-4175465172/)

nschklar 06-07-2013 09:29 PM

trying to run "java -jar start.jar" at boot Centos6.4
 
What do I add to where to make this run on boot?
I would like to be able to stop and start like a service.

Norm

fredak 06-09-2013 05:25 PM

/etc/rc.d
 
Quote:

Originally Posted by nschklar (Post 4967520)
What do I add to where to make this run on boot?
I would like to be able to stop and start like a service.

Norm

services are in the /etc/rc.d directory

have a look at the shells that are in it and make your own shell

they run automatically on boot if they are executable ( chmod +x)

btmiller 06-09-2013 09:10 PM

If you just need to run a single command, e.g. to launch a daemon, you can usually add it to /etc/rc.local, although doing the full SysV style init stuff in /etc/rc.d/ or /etc/init.d (exact location depends on which distribution you're using). However, be advised that all start-up script run with root privileges. If you want your application to not run as root (usually a very good idea for security reasons) and it doesn't srop privileges on its own, be sure tyo have the startup script or rc.local command drop privileges for it (generally su'ing to the target account should be good enough).


All times are GMT -5. The time now is 10:25 AM.