Operating System - HP-UX
1847514 Members
4688 Online
110265 Solutions
New Discussion

Start daemons upon bootup

 
Greg Huber_3
Occasional Contributor

Start daemons upon bootup

I am trying to have a couple application daemons start upon bootup. I know cron
will schedule to have an item run, but only at a specified time or day.
What does it take to make this happen?

Thanks in advance!
1 REPLY 1
Anthony Goonetilleke_1
Regular Advisor

Re: Start daemons upon bootup

The first thing you need to do is look at a file called /sbin/init.d/template
copy this file to the name of your daemon and edit it to include your daemon
executables and any other things you need to do. You can look at some of the
other scripts in their if you need more help.

Once you have finished have a look at /etc/rc.config.d this is where the
customisation files for all the executable scripts in /sbin/init.d are stored.
Add the appropriate file for your daemon, here again you can look at some of
the examples.

Now you have to decide what run level you want to start your daemon up in
usually this will be in Run-Level 2 or 3 once you have decided this add a link
from either /sbin/rc2.d or rc3.d to the startup file you created in
/sbin/init.d

The naming conventions of these files follow the following sequence

/sbin/rc2.d/S990mydaemon

rc2.d --> Run Level
S --> Type this can be either S-startup or K-shutdown
730 --> sequence number
mydaemon -->Service name

When the system comes up /sbin/rc executes the "S" scripts in the respective
rc*.d directories in increasing order. When the system comes down /sbin/rc
executes the "K" scripts in the appropriate directory in ascending order by
number.

Hope this helps,
AG