Operating System - HP-UX
1827249 Members
2705 Online
109716 Solutions
New Discussion

Process not starting properly from /sbin/rc3.d on HPUX

 
Craig A. Sharp
Super Advisor

Process not starting properly from /sbin/rc3.d on HPUX

I have a process start that has been put into /sbin/rc3.d as S999nrpe. This should be the last process to start. It is a link to the actual bin directoy and executable file. This executable file lives in /opt/nrpe/bin so the S999nrpe file is just a link back to that file. This executable will not start on reboot. If I am correct the reason is that the S999nrpe should be linked to a startup entry in /sbin/init.d which points to the actual executable in /opt/nrpe/bin. Any suggestions?
3 REPLIES 3
F Verschuren
Esteemed Contributor

Re: Process not starting properly from /sbin/rc3.d on HPUX

does the sript works on the comand line?
is /etc/rc.log says someting?
is the it a shell script? is so is the first line !#/sbin/ksh (ore a other shell?)

can you replay a
ll /sbin/rc3.d/S999nrpe
ans all the links it is refering to?
James R. Ferguson
Acclaimed Contributor

Re: Process not starting properly from /sbin/rc3.d on HPUX

Hi Craig:

Several comments:

1. Read the 'rc(1M)' manpages and follow the instructions.

2. Use the '/sbin/init.d/template' for your script, but be sure to set the PATH you need and change the '$CONTROL_VARIABLE' to something you define in '/etc/rc.config.d/<scriptname>'.

3. Remember that the environment provided is very sparse. you must define your PATH and are advised to use absolute ones. You will need to define any environmental variables you need, too.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: Process not starting properly from /sbin/rc3.d on HPUX

First make sure that your process starts if you execute it from an interactive shell (e.g. /sbin/init.d/xxxx start). Until that works, you don't have a prayer. However, that is a necessary but not sufficient condition. Your interactive environment may have environment variables defined and exported (including PATH) that your rc'ed script may not. You may need to explicitly set these in your rc script. Finally there is one other difference between an interactive environment and an rc'ed one --- and that is (duh) that it is interactive --- meaning that stdin, stdout, and stderr are connected to a tty (terminal-like) device. If the program expects a tty device for any of these then that can also cause failures.
If it ain't broke, I can fix that.