#! /bin/sh # # cupsys example file to build /etc/init.d/ scripts. # This file should be used to construct scripts for /etc/init.d. # # Written by Miquel van Smoorenburg . # Modified for Debian GNU/Linux # by Ian Murdock . # # Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl # # This file was automatically customized by dh-make on Sun, 3 Oct 1999 20:58:02 -0500 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/cupsd NAME=cupsd DESC="Common Unix Printing System" test -f $DAEMON || exit 0 set -e # Get the timezone set. if [ -e /etc/timezone ]; then TZ=`cat /etc/timezone` export TZ fi case "$1" in start) echo -n "Starting $DESC: $NAME" chown root:lpadmin /usr/share/cups/model 2>/dev/null || true chmod 3775 /usr/share/cups/model 2>/dev/null || true start-stop-daemon --start --quiet --background -m --pidfile /var/run/cups/cupsd.pid --exec $DAEMON -- -F echo "." ;; stop) echo -n "Stopping $DESC: $NAME" start-stop-daemon --stop --quiet --retry TERM/10 --oknodo --exec $DAEMON rm -f /var/run/cups/cupsd.pid echo "." ;; reload) echo -n "Reloading $DESC: $NAME" start-stop-daemon --stop --quiet --oknodo --signal 1 --exec $DAEMON echo "." ;; restart|force-reload) echo -n "Restarting $DESC: $NAME" if start-stop-daemon --stop --quiet --retry TERM/10 --oknodo --exec $DAEMON; then start-stop-daemon --start --quiet --background -m --pidfile /var/run/cups/cupsd.pid --exec $DAEMON -- -F fi echo "." ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0