wok annotate cups/stuff/etc/init.d/cupsd @ rev 22686

Up pssh (2.3.1)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jan 19 16:24:05 2020 +0100 (2020-01-19)
parents 7f188676b59c
children
rev   line source
pankso@632 1 #!/bin/sh
al@19161 2 # /etc/init.d/cups: Start, stop and restart CUPS daemon 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
al@19159 12 DESC="$(_ '%s daemon' CUPS)"
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@19159 19 action 'Stopping %s: %s...' "$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@19159 27 action 'Starting %s: %s...' "$DESC" $NAME
slaxemulator@7043 28 $DAEMON $OPTIONS
slaxemulator@7043 29 status
slaxemulator@7043 30 else
al@19159 31 _ '%s is already running.' $NAME
slaxemulator@7043 32 fi
pankso@664 33 ;;
pankso@664 34 *)
al@19159 35 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop]"
al@18716 36 newline
pankso@664 37 exit 1
pankso@664 38 ;;
pankso@632 39 esac
pankso@632 40
pankso@632 41 exit 0