Starting a Program at Boot-time

First step is to become root. One of the following should do

sudo su
ssh root@localhost

Next step is to copy the skeleton service:

cp /etc/init.d/skeleton /etc/init.d/SERVICENAME

Then update the copy to make sure that the variables DESC, NAME, DAEMON, DAEMON_ARGS, PIDFILE, and SCRIPTNAME are correct:

nano /etc/init.d/SERVICENAME

Then depending on distribution run one of the following (first is for debian, last is for redhat):

update-rc.d SERVICENAME defaults
chkconfig SERVICENAME on

Advertisements

Tags: , , , , , , , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: