- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script to reset print spooler
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2002 09:53 AM
тАО04-09-2002 09:53 AM
script to reset print spooler
Thanks,
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2002 09:56 AM
тАО04-09-2002 09:56 AM
Re: script to reset print spooler
#!/usr/bin/ksh
#
then add your commands to it, then tell cron to run it once a day.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2002 09:59 AM
тАО04-09-2002 09:59 AM
Re: script to reset print spooler
/sbin/init.d/lp stop
/sbin/init.d/lp start
That will restart the spooler
put the script in cronjob.
-pap
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2002 10:03 AM
тАО04-09-2002 10:03 AM
Re: script to reset print spooler
The real problem to SOLVE is WHY is it hanging the spool queue? Solve that problem and you don't need to "bounce" the spooler.
Can any of this be answered?
* What are you "capturing"?
* how are you doing it (capturing)?
* how are you sending it to the print queue?
* is the printer hung?
* are there any "control" or "escape sequences" in the file being sent to the printer?
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2002 10:09 AM
тАО04-09-2002 10:09 AM
Re: script to reset print spooler
First the reason as to why it happenes to be found out . Incase still you want the script
add the following to the cron of the root
0 1 * * * /usr/local/adm/lprestart
and under the directory /usr/local/adm
create and executable script
#!bin/sh
/usr/sbin/lpshut
sleep 30
/usr/sbin/lpsched
please make sure that the permissions are set to excutable
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2002 10:26 AM
тАО04-09-2002 10:26 AM
Re: script to reset print spooler
It deals with spooler hangs and such -- maybe that is what you are encountering and it can be resolved with a patch.
Hope that helps.
Ross Martin
HP Response Center
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2002 10:41 AM
тАО04-09-2002 10:41 AM
Re: script to reset print spooler
The process to shutdown the spooler and restart it is simply:
# lpshut
# lpsched
However, you might want to call the standard HP-UX start/stop script as in:
# /sbin/init.d/lp stop
# /sbin/init.d/lp start
Just put this into a script such as:
#!/usr/bin/sh
/sbin/init.d/lp stop
/sbin/init.d/lp start
But you might also check for hung instances of lp processes:
# ps -u lp
So the script becomes:
#!/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
Put the above into a script, test it to see that it really works OK (hint, use sh -x ro run the script) and then add it to cron.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2002 10:56 PM
тАО04-09-2002 10:56 PM
Re: script to reset print spooler
All good advice especially for the patches.
One more.
Check the value of nproc and maxuprc.
If maxuprc is low the spooler can hang.
Steve Steel