Discussion Locked

Automatic startup of server application

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I just installed the Java sdk enterprise edition and want to get it to autostart on boot up. I know this is probably an easy one, but I can't figure it out. do I make a symbolic link in the init.d directory? a script? help is much appreciated.

9 replies

by zbrain75

To start when the system boots put your startup command(s) in the file:
/etc/rc.d/rc.local
This is the last script file run every time the system boots.

If you would rather start it when a user logs in put the startup commands in the users homedirectory in the file:
/home/username/.bash_login
otherwise referred to as $HOME/.bash_login.

by jpereira

Put a startup script in the init.d directory and a symbolic link in the rc3.d (assuming run level 3 is your normal init state). The symbolic link should name SxxRestOfScriptName where xx is a two digit number which tells the system what order to run the scripts in (there will be loads of others in that directory already). Your startup script should take one parameter which will be either "start" "stop" or "restart". When the system enters init state 3 it'll run the script with "start" as theparameter, when it leaves init state 3, it'll run the script with "stop" as the parameter.

by jgreen

After creating the script in init.d, you may want to look at the "update-rc" script, which will put the appropriate symbolic links into the proper rc#.d directories for startup/shutdown of your service.

This discussion is closed to new replies.