Operating System - HP-UX
1830936 Members
1959 Online
110017 Solutions
New Discussion

Re: how to start a program as a daemon on HP UX

 
inactive account
Frequent Advisor

how to start a program as a daemon on HP UX

Hi everybody,
Anybody can explain me how to start a process at startup?

Thanx
6 REPLIES 6
Jean-Louis Phelix
Honored Contributor

Re: how to start a program as a daemon on HP UX

Hi,

If you mean machine startup, then you could use template defined in /sbin/init.d/template. Then you have to use eventually variables from /etc/rc.config.d depending on what you wrote and links to /sbin/rcX.d. If your program is not a daemon, then use nohup. See man rc and man rc.config.

Regards,

Jean-Louis.
It works for me (© Bill McNAMARA ...)
S.K. Chan
Honored Contributor

Re: how to start a program as a daemon on HP UX

This will explain in greater detail.
http://docs.hp.com/hpux/onlinedocs/os/startup.pdf
It a nutshell, there are 3 things you got to do.
1) Creating the startup script and place it in /sbin/init.d. It's best to use the existing file called "template" in /sbin/init.d for consistency.
2) Create the control file and put it in /etc/rc.config.d. This allows you to quickly enable or disable a startup script by simply setting the appropriate variable to 1 or 0.
3) Create the startup/shutdown symbolic link at the appropriate run level in /sbin/rc.d.
Robert-Jan Goossens_1
Honored Contributor

Re: how to start a program as a daemon on HP UX

hi,

If you mean at boottime, look at the scripts in /sbin/rc2.2 K***** and S****.

Regards

Robert-Jan.
James R. Ferguson
Acclaimed Contributor

Re: how to start a program as a daemon on HP UX

Hi:

If you really want to understand the startup/shutdown paradigm, see this short, but well-written, extensive discussion here:

http://docs.hp.com/hpux/onlinedocs/os/startup.pdf

While originally written for 10.x, this white paper is applicable to all current releases, too.

Regards!

...JRF...
Jack Werner
Frequent Advisor

Re: how to start a program as a daemon on HP UX

Just a foot-note,

If you want a process to be inherited by INIT, surround its invocation with parentheses[ie (command)].
i'm retired
inactive account
Frequent Advisor

Re: how to start a program as a daemon on HP UX

provided document link was helpful