Operating System - HP-UX
1752295 Members
4755 Online
108786 Solutions
New Discussion юеВ

Re: AUTOSTART a daemon at boot time

 
Kwahae_1
Regular Advisor

AUTOSTART a daemon at boot time

Hi, I would like to autostart a Nagios daemon at boot time using the command /opt/iexpress/nagios/bin/nrpe -c /opt/iexpress/nagios/etc/nrpe.cfg -d

How exactly do I fit this in the /sbin/rc3.d scenario?

Am running hp-ux 11v2.

Thanks
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor

Re: AUTOSTART a daemon at boot time

Hi:

Have a look at the 'rc(1M)' manpages or this whitepaper. Either source describes the run-level paradigm used in HP-UX. Be sure to follow the simple steps and rules and you will have no problems with implementing start/stop scripts and daemons.

http://docs.hp.com/en/934/startup.pdf

http://docs.hp.com/en/B2355-60130/rc.1M.html

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: AUTOSTART a daemon at boot time

Shalom,

Most HP-UX ported software configurations include a configuration options file in /etc/rc.config.d

There is usually an auto start variable in there that you set to 1 for automatic daemon start.

Otherwise you will need to softlink to the startup script a start captial S to start in rc3.d and K to kill in rc2.d

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Tingli
Esteemed Contributor

Re: AUTOSTART a daemon at boot time

You need to do several things to start Nagios.

First prepare a file under /etc/init.d with a name like nagios. It should look like other application startup files.

Then have a file ready in /etc/rc.config.d/, which is the switch for startup process. You can find similar files in the same directory.

Finally, you make a link in /etc/rc3.d for startup and/or in /etc/rc2.d for shut down Nagios by using ln -s /etc/init.d/nagios /etc/rc3.d/S***nagios and ln -s /etc/init.d/nagios /etc/rc2.d/Kxxxnagios. The *** and xxx are 3 digit numbers and their sum supposed to be 1000.

Or you can start nagios in another way, that have it in /etc/inetd.conf file. Nagios's manual should have more details about it.