Operating System - HP-UX
1834512 Members
2147 Online
110068 Solutions
New Discussion

Re: Startup scripts not starting processes

 
Randy Brown_1
Frequent Advisor

Startup scripts not starting processes

I have an HP-UX 10.20 machine that I have having some trouble with. I cannot get lp and xntpd to run using the default startup scripts. The OS was recently installed on the machine. When I try to start lp or xntpd using the startup scripts (/sbin/init.d/lp start or /sbin/init.d/xntpd start) nothing happens. If I run /usr/sbin/lp ot xntpd the process will start, but I can't figure out why the startup scripts aren't working. The rc.log says these processes are being SKIPPED during boot. I have compared things to a similar machine that works but can't find the difference. Any help would be greatly appreciated, and if more information is needed, I will gladly provide it.

TIA,

Rand
10 REPLIES 10
Stefan Farrelly
Honored Contributor

Re: Startup scripts not starting processes

Both lp and xntpd use default config files in /etc/rc.config.d (called lp and for xntpd its called netadmons). In there you must set a variable to 1 for the /sbin/init.d scripts to start them. You can always run with debug on to see why the startup script in /sbin/init.d is not working; sh -x /sbin/init.d/lp start

In some cases you cannot use the script in /sbin/init.d, you must use the startup or kill script in the appropritae /etc/rc.d directory.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Marco Santerre
Honored Contributor

Re: Startup scripts not starting processes

What you may want to check is the /etc/rc.config.d directory where you usually have a similar file to the one found in /sbin/init.d, and if you view it, you will find a variable with a 1 or a 0. If the variable is set to 0, then the script will be skipped and not executed. In order to change that, change that variable to 1.

You will find the /etc/rc.config.d/lp and make sure it is set at 1. And for xntpd, you will find a file called /etc/rc.config.d/netdaemons with many variables inside of that file, including the XNTPD variable.
Cooperation is doing with a smile what you have to do anyhow.
James R. Ferguson
Acclaimed Contributor

Re: Startup scripts not starting processes

Hi Rand:

The '/sbin/rc' startup/shutdown mechanism sources (reads) files in '/etc/rc.config.d/' to collect variable which control whether or not a script in '/sbin/init.d/' will run or not.

This is the source (no pun intended!) of your problem. For example, '/sbin/init.d/lp' only executes if the environmental variable 'LP' has been set to '1' in '/etc/rc.config.d/lp'.

For a complete understanding of the startup/shutdown mechanism, have a look at this document:

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

Regards!

...JRF...
Randy Brown_1
Frequent Advisor

Re: Startup scripts not starting processes

Thank you! That was it for xntpd, but not for lp. the /etc/rc.config.d lp file already had LP=1 in it. Hmmm. Puzzling.

More info...
We use a monitoring system called Big Brother and it is set up to monitor processes running on our machine among other things. On this particular machine it is showing lpsched as being down. Maybe I am wrong in thinking lp is what I need to be starting to get lpsched running. I can manually start it. Any thoughts?

Thanks again,

Randy
A. Clay Stephenson
Acclaimed Contributor

Re: Startup scripts not starting processes

No "lp" does not start "lpsched". I would do this.

lpshut

ps -ef | grep lpsched
If you see any processes, kill them.

cd /var/spool/lp
ls
if your see the files FIFO, CLD_FIFO, or SCHEDLOCK, remove them.
lpsched

The LP scheduler should now be running and should start on system boot as well with the rc.config.d setting as you indicated.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: Startup scripts not starting processes

Hi (again) Randy:

'/sbin/init.d/lp' indeed starts 'lpsched'. The condition is that the environmental variable 'LP' equals one (1) *and* that there is a file '/var/spool/lp/pstatus' whose size is greater than zero. Is that the case for your server?

Regards!

...JRF...
Randy Brown_1
Frequent Advisor

Re: Startup scripts not starting processes

the /var/spool/lp/pstatus file is indeed 0. AND, it is not 0 on my working machine. Sounds like that's it. How can I make this file >0? Copy it from the working machine?

Thanks again,

Randy
James R. Ferguson
Acclaimed Contributor

Re: Startup scripts not starting processes

Hi (again) Radny:

OL, then do this to correct:

# lpadmin -pnada -mdumb -v/dev/null

Regards!

...JRF...
Randy Brown_1
Frequent Advisor

Re: Startup scripts not starting processes

Thank you! That did it. These forums are great.

Randy
Stuart Abramson_2
Honored Contributor

Re: Startup scripts not starting processes

Rand:

Yes they are.

Reward these guys with some points.

Stuart