Operating System - HP-UX
1834800 Members
2911 Online
110070 Solutions
New Discussion

Re: I can't start spooler

 
Jose Ramirez_6
Advisor

I can't start spooler

hi.

I can't start spooler whit the command lpsched. The system reply whit:

sdmadr8:/home/root >lpsched
scheduler is running

If i attemp stop the spooler The system reply whit:

sdmadr8:/home/root >lpshut
lpshut: scheduler not running

thank for your help.
jose ramirez
13 REPLIES 13
Jeff Schussele
Honored Contributor

Re: I can't start spooler

Hi Jose,

You need to rm the SCHEDLOCK file in the /var/spool/lp directory before you can restart the lp spooler.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Helen French
Honored Contributor

Re: I can't start spooler

Hi Jose:

Check /var/spool/lp directory. If you have a file called - SCHEDLOCK, then delete it and try again.

Also try with SAM

HTH,
Shiju
Life is a promise, fulfill it!
pap
Respected Contributor

Re: I can't start spooler

Hi Jose,
I didn't see any errors in your posting.
It is the normal way the lp command behaves.

If you want to start lp and give #lpsched
it will give you a message showing your scheduler has been started.

by running #lpshut
it gives the message that Scheduler is not running.....this is the mesage after your command.

So, in your case nothing wrong. everything is alright.

-pap

"Winners don't do different things , they do things differently"
Jeff Schussele
Honored Contributor

Re: I can't start spooler

Hi Piyush,

What Jose is seeing is what will always happen when the spooler crashes or is killed w/kill -9. The SCHEDLOCK file is not removed in these cases.
When the lpsched script runs it sees the SCHEDLOCK & stops as it thinks the spooler is still running.
When the lpshut script runs it checks for the PID specified in the PID file, does not find it & knows spooler is not running.
Test it yourself on a test box - kill -9 the lpsched PID & then try to start/stop.
Seen it many times......

Best Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Victor_5
Trusted Contributor

Re: I can't start spooler

1. lpshut
2. rm /var/spool/lp/FIFO
rm /var/spool/lp/SCHEDLOCK
3. > outputq
4. lpsched
6. vefiry
ps -ef |grep lpsched
lpstat -t |more

Jose Ramirez_6
Advisor

Re: I can't start spooler

Hi.

The Files SCHEDLOCK and FIFO don't exist. and if i start de spooler (lpsched) the system reply:

the spoleer is already started.

if i stop de spooler (lpshut) the system reply:

then spooler is already stoped.
jose ramirez
steven Burgess_2
Honored Contributor

Re: I can't start spooler

Hi

Check for hung spooler processes

The following script was supplied by Bill Hassell not so long ago

#!/usr/bin/sh
/sbin/init.d/lp stop
sleep 2

PID4LP=$(/usr/bin/ps -u blh | awk '$1 !~ /PID/ {print $1}')
if [ $PID4LP#} -ne 0 ]
then
for PIDLP in $PID4LP
do
/usr/bin/kill -9 $PIDLP
done
/sbin/init.d/lp start

Regards

Steve
take your time and think things through
steven Burgess_2
Honored Contributor

Re: I can't start spooler

Hi


sorry, the above script doesn't appear to be correct. I am sorting it out at the moment and will reply with correct

Steve
take your time and think things through
steven Burgess_2
Honored Contributor

Re: I can't start spooler

Hi Jose

Try

#!/usr/bin/sh

/sbin/init.d/lp stop 2> /dev/null
sleep2

ps -u lp | awk '$1 !~ /PID/ {print $1}' >> /tmp/process

PROCESS=/tmp/process
for lpproc in $(cat $PROCESS)
do
kill -9 $lpproc
done
/sbin/init.d/lp start

I think Bill just passed the script as an example of what you could do, not exactly what to do

Regards

Steve


take your time and think things through
Jose Ramirez_6
Advisor

Re: I can't start spooler

Hi.

I exec the script but the problem continue.

I see that the process related whit the spooler no exist in the system.
jose ramirez
Jeff Schussele
Honored Contributor

Re: I can't start spooler

MANOJ SRIVASTAVA
Honored Contributor

Re: I can't start spooler

Hi Jose

If you do a ps -ef | grep lp do u see a lpsched owned by lp , and the ppid set to 1 ?

and also there shopuld be only one entry .If not so then you will have to reload the lp services , a good place is to check the ownership for the direcotries under /var/spool/lp . What is the error you get when u try doing the same through SAM ?


Manoj Srivastava
Jose Ramirez_6
Advisor

Re: I can't start spooler

the problem is that the spooler is corruct. I See the
error in the file /var/adm/lp/log.

the solutions is restore the spooler from SAM.

jose ramirez