Operating System - HP-UX
1751889 Members
5497 Online
108783 Solutions
New Discussion юеВ

HP-UX Startup process question

 
SOLVED
Go to solution
Viet Q Do
Advisor

HP-UX Startup process question

We would like to add a script to start a process during system bootup. Please anyone tell us what the best way to do this. How to check if the script started and successfully executed? We currently using HP-UX 11.11. Thanks.
5 REPLIES 5
TTr
Honored Contributor

Re: HP-UX Startup process question

You can look at any of the existing startup scripts in /sbin/init.d and use them as a model. Look at the simpler ones such as syslogd and lp and modify and customize them accordingly. After that you set up start and kill links in /sbin/rc3.d and /sbin/rc2.d.
To check if you process has started, use your process' exit codes it has any, or check for the existence of a process name, or make a connection to it and test it out.
James R. Ferguson
Acclaimed Contributor

Re: HP-UX Startup process question

Hi Viet:

> We would like to add a script to start a process during system bootup. Please anyone tell us what the best way to do this.

The best way is the correct way. See tha manpages for 'rc(1M)'.

For a more detailed discussion, see this (still valid) whitepaper:

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

Use the file '/sbin/init.d/template' as the template (copy it) for your startup/shutdown script.

After you have properly coded your requirements, the 'etc/rc.log' will record the success or failure of your script's execution.

Regards!

...JRF...
SKR_1
Trusted Contributor

Re: HP-UX Startup process question

You can add your scripts in the following locations.

/sbin/rc3.d and /sbin/rc2.d

Thanks
SKR
Sandeep_Chaudhary
Trusted Contributor
Solution

Re: HP-UX Startup process question

u have to place main script in /sbin/init.d

and startscript/stopscript link should be in /sbin/rc2.d OR /sbin/rc3.d
root as root@suxde012 [/sbin/rc2.d]
# ll
total 0
lrwxr-xr-x 1 root sys 19 Jan 22 2007 K010OVCtrl -> /sbin/init.d/OVCtrl
lrwxr-xr-x 1 root sys 21 Jan 22 2007 K020OVTrcSrv -> /sbin/init.d/OVTrcSrv
lrwxr-xr-x 1 root sys 23 Jan 12 2004 K100dtlogin.rc -> /sbin/init.d/dtlogin.rc
lrwxr-xr-x 1 bin bin 18 Oct 14 2006 K172kwdbd -> /sbin/init.d/kwdbd
lrwxr-xr-x 1 bin bin 24 Jan 12 2004 K177hpws_apache -> /sbin/init.d/hpws_apache
lrwxr-xr-x 1 bin bin 24 Jan 12 2004 K177hpws_tomcat -> /sbin/init.d/hpws_tomcat
lrwxr-xr-x 1 bin bin 24 Jan 12 2004 K177hpws_webmin -> /sbin/init.d/hpws_webmin
lrwxr-xr-x 1 bin bin 26 Jan 12 2004 K177hpws_xmltools -> /sbin/init.d/hpws_xmltools
lrwxr-xr-x 1 root sys 19 Jan 12 2004 K200tps.rc -> /sbin/init.d/tps.rc
lrwxr-xr-x 1 root sys 21 Jan 12 2004 K890idsagent -> /sbin/init.d/idsagent
lrwxr-xr-x 1 root bin 23 Jan 12 2004 K900nfs.server -> /sbin/init.d/nfs.server
lrwxr-xr-x 1 root bin 21 Jan 12 2004 S008net.init -> /sbin/init.d/net.init
lrwxr-xr-x 1 bin bin 25 Jan 12 2004 S096vxvm-recover -> /sbin/init.d/vxvm-recover
lrwxr-xr-x 1 bin bin 21 Jan 12 2004 S120swconfig -> /sbin/init.d/swconfig
Viet Q Do
Advisor

Re: HP-UX Startup process question

Hi TTr, James, SKR, and Sandeep,
Thanks for a quick reply on this particular subject. I believe I have enough information to go on implementing our script. I will let you know if I need any more information. I've given points to each of you as a way to say thank you for your help.
Sincerely.