wok view cups/stuff/etc/init.d/cupsd @ rev 14648

cups/stuff/etc/init.d/cupsd: fix shutdown
author Richard Dunbar <mojo@slitaz.org>
date Mon Jun 03 20:00:49 2013 +0000 (2013-06-03)
parents d66c8cb687e8
children 531807aaf860
line source
1 #!/bin/sh
2 # /etc/init.d/cups: Start, stop and restart Cups deamon on SliTaz, at boot
3 # time or with the command line.
4 #
5 # To start daemon at boot time, add cupsd to the $RUN_DAEMONS variable
6 # of /etc/rcS.conf and configure options with /etc/daemons.conf.
7 #
8 . /etc/init.d/rc.functions
9 . /etc/daemons.conf
11 NAME=Cupsd
12 DESC="cups deamon"
13 DAEMON=/usr/sbin/cupsd
14 OPTIONS=$CUPSD_OPTIONS
15 PIDFILE=/var/run/cups/cups.sock
17 case "$1" in
18 stop)
19 echo -n "Stopping $DESC: $NAME... "
20 kill $(pgrep -f cupsd)
21 rm -f $PIDFILE
22 status
23 ;;
24 start)
25 if [ ! -e $PIDFILE ]; then
26 echo -n "Starting $DESC: $NAME... "
27 $DAEMON $OPTIONS
28 status
29 else
30 echo -n "Not starting $DESC: $DESC is already running"
31 false
32 status
33 fi
34 ;;
35 *)
36 echo ""
37 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop]"
38 echo ""
39 exit 1
40 ;;
41 esac
43 exit 0