wok-next annotate cups/stuff/etc/init.d/cupsd @ rev 18716
cups, cups-pam: remove duplicate files with libcups; misc. edits.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Thu Dec 17 05:25:15 2015 +0200 (2015-12-17) |
parents | 0a8a8c347a7e |
children | 7f188676b59c |
rev | line source |
---|---|
pankso@632 | 1 #!/bin/sh |
al@18716 | 2 # /etc/init.d/cups: Start, stop and restart CUPS deamon on SliTaz, at boot |
pankso@632 | 3 # time or with the command line. |
pankso@632 | 4 # |
al@18716 | 5 # To start daemon at boot time, add 'cupsd' to the $RUN_DAEMONS variable |
mojo@14648 | 6 # of /etc/rcS.conf and configure options with /etc/daemons.conf. |
pankso@632 | 7 # |
pankso@632 | 8 . /etc/init.d/rc.functions |
pankso@632 | 9 . /etc/daemons.conf |
pankso@632 | 10 |
pankso@632 | 11 NAME=Cupsd |
pankso@632 | 12 DESC="cups deamon" |
pankso@632 | 13 DAEMON=/usr/sbin/cupsd |
pankso@632 | 14 OPTIONS=$CUPSD_OPTIONS |
pankso@632 | 15 PIDFILE=/var/run/cups/cups.sock |
pankso@632 | 16 |
pankso@632 | 17 case "$1" in |
pankso@664 | 18 stop) |
al@18716 | 19 action 'Stopping $DESC: $NAME... ' |
mojo@14648 | 20 kill $(pgrep -f cupsd) |
pascal@15342 | 21 sleep 2 |
pascal@15609 | 22 [ -e /var/run/cups/cups.sock ] && rm -f $PIDFILE |
pankso@664 | 23 status |
pankso@664 | 24 ;; |
pankso@2208 | 25 start) |
al@18716 | 26 if ! active_pidfile $PIDFILE cupsd 2>/dev/null; then |
al@18716 | 27 action 'Starting $DESC: $NAME... ' |
slaxemulator@7043 | 28 $DAEMON $OPTIONS |
slaxemulator@7043 | 29 status |
slaxemulator@7043 | 30 else |
al@18716 | 31 action 'Not starting $DESC: $DESC is already running' |
al@18716 | 32 false; status |
slaxemulator@7043 | 33 fi |
pankso@664 | 34 ;; |
pankso@664 | 35 *) |
al@18716 | 36 emsg "<n><b>Usage:</b> /etc/init.d/$(basename $0) [start|stop]" |
al@18716 | 37 newline |
pankso@664 | 38 exit 1 |
pankso@664 | 39 ;; |
pankso@632 | 40 esac |
pankso@632 | 41 |
pankso@632 | 42 exit 0 |