PDA

View Full Version : [ubuntu] How can I setup my server program auto-run as a service when startup?


mrmrcc
September 19th, 2009, 12:12 PM
How can I setup my server program auto-run as a service when startup? Thanks in advance!!

openfly
September 19th, 2009, 01:15 PM
You need to learn to use init.d/

Or you could hide it somewhere in another startup script. Biggest issue to be aware of is run levels and how scripts execute in each of them.

Not sure if ubuntu rocks an /etc/rc file. Some do support it as a legacy startup script. It's the easiest to interface with, but you'd learn a lot and be a better person for learning how init.d scripts are called and written.

Rob_H
September 19th, 2009, 02:20 PM
Take look at the man page for update-rc.d. It will help you set up the necessary links to your startup/shutdown script.
man update.rc.d