[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Cron run-parts /etc/cron.weekly



Hmm... I've been getting this for a few weeks:

> run-parts: /etc/cron.weekly/lpr exited with return code 1

Running by hand causes no problems.  Then I piped the output to mail, and
when it arrives, the lpd restart only echos a ".".  Any ideas?  This is a
relatively up to date hamm system.

dpkg -l lpr:
ii  lpr             5.9-23         BSD lpr/lpd line printer spooling system

TIA,
Brandon

P.S. Scripts appended for the interested few.

-----
Brandon Mitchell <bhmit1@mail.wm.edu>   "We all know linux is great... it
PGP: finger -l bhmit1@cs.wm.edu          does infinite loops in 5 seconds"
Phone: (757) 221-4847                      --Linus Torvalds

/etc/cron.weekly/lpr:
#! /bin/sh

savelog -t /var/log/lp-acct /var/log/lp-errs | mail -s "lpr savelog" bhmit1

/etc/init.d/lpd restart | mail -s "lpr restart" bhmit1

/etc/init.d/lpd:
#!/bin/sh
#
# Start the printer daemon.

set -e

test -x /usr/sbin/lpd || exit 0

case "$1" in
  start)
	echo -n "Starting printer spooler: lpd"
	start-stop-daemon --start --quiet --exec /usr/sbin/lpd
	echo "."
	;;
  stop)
	echo -n "Stopping printer spooler: lpd"
	start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/lpd.pid
	echo "."
	;;
  restart|force-reload)
	echo -n "Restarting printer spooler: lpd"
	start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/lpd.pid
	start-stop-daemon --start --quiet --exec /usr/sbin/lpd
	echo "."
	;;
  *)
        echo "Usage: /etc/init.d/lpd {start|stop|restart}"
        exit 1
esac

exit 0



--
E-mail the word "unsubscribe" to debian-user-request@lists.debian.org
TO UNSUBSCRIBE FROM THIS MAILING LIST. Trouble?  E-mail to listmaster@debian.org .


Reply to: