LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   centos 5: need to start a java prog at boot/startup (https://www.linuxquestions.org/questions/linux-server-73/centos-5-need-to-start-a-java-prog-at-boot-startup-775005/)

deostroll 12-11-2009 02:12 PM

centos 5: need to start a java prog at boot/startup
 
Hi,

I need to set a java program to run at startup/boot. What do I do for this...?

EricTRA 12-11-2009 02:40 PM

Hello,

You could write a small script with executable permissions that contains your java command with all parameters as you would execute it from a terminal. Then you could add that script to the /etc/rc.d/rc.local script that gets executed at boot by init. This way you don't have to write any initialization scripts in the /etc/rc.d/init.d/ directory. If you want it to depend on the runlevels then you'll need to write a 'chkconfig ready' script and run the chkconfig utility (man chkconfig).

Kind regards,

Eric


All times are GMT -5. The time now is 06:37 AM.