To automagically restart cups when it fails, i added a crontab entry:
Code:
root@print-me:/var/log# crontab -l
# m h dom mon dow command
*/3 * * * * /root/scripts/checkcups >> /var/log/checkcups 2>&1
root@print-me:/var/log# cat /root/scripts/checkcups
#!/bin/bash
ps -ef | grep -i cupsd | grep -i conf > /dev/null
if [ $? == 1 ]; then
date
echo "cupsd is down, lets try to start it."
/etc/init.d/cups restart
else
exit
fi
root@print-me:/var/log# cat /var/log/checkcups
-bash: /root/scripts/checkcups: No such file or directory
/bin/sh: /root/scripts/checkcups: not found
Wed Apr 6 16:27:22 CEST 2011
cupsd is down, lets try to start it.
* Restarting Common Unix Printing System: cupsd
...done.
Fri Apr 8 06:36:01 CEST 2011
cupsd is down, lets try to start it.
* Restarting Common Unix Printing System: cupsd
...done.
Sat Apr 9 06:54:01 CEST 2011
cupsd is down, lets try to start it.
* Restarting Common Unix Printing System: cupsd
...done.
root@print-me:/var/log#
I modified it to get the segfaults in the new log:
Code:
root@print-me:/var/log# cat /root/scripts/checkcups
#!/bin/bash
ps -ef | grep -i cupsd | grep -i conf > /dev/null
if [ $? == 1 ]; then
date
echo "message scrap"
echo "====================================================================================="
grep cupsd -A 4 -B 4 cupsd /var/log/messages | tail -n 9
echo "kern.log scrap"
echo "====================================================================================="
grep cupsd -A 4 -B 4 cupsd /var/log/kern.log | tail -n 9
echo "cups error_log scrap"
echo "====================================================================================="
tail /var/log/cups/error_log-print-me
echo "cupsd is down, lets try to start it."
/etc/init.d/cups restart
else
exit
fi
I noticed there was an update for cups in the respository, loglevel debug1 works now without segfault, debug2 still generates segfaults.
Bookmarks