Operating System - HP-UX
1834608 Members
2712 Online
110069 Solutions
New Discussion

Re: script - printer scheduler process

 
Jagadesh_2
Regular Advisor

script - printer scheduler process

Hi,

I need a script which should scheck for the printer scheduler process, if it fails it should restart the same.

I will be adding this script to cron to run for every 1 hour time.

Thanks
jagadesh
3 REPLIES 3
RAC_1
Honored Contributor

Re: script - printer scheduler process

Some like follows.

lpstat -r || lpsched -v

There is no substitute to HARDWORK
Jagadesh_2
Regular Advisor

Re: script - printer scheduler process

lpstat -r will let us know whether the scheduler is running or not so..
we need to use that output in the script matching to "scheduler not running" and if this condition is true we can restart the scheduler right?
A. Clay Stephenson
Acclaimed Contributor

Re: script - printer scheduler process

Yes, that is what lpstat -r does. You are really addressing the symptoms rather than the problem itself. You need to understand why lpsched is dying. Often, simply issueing an lpsched command is not enough because you also need to explicitly remove the SCHEDLOCK and/or the FIFO lock files before doing an lpsched. I would first look for and apply any lp related patches. Fix the problem and you won't need a cron Band-Aid.
If it ain't broke, I can fix that.