wok annotate c_icap/stuff/c-icapd @ rev 18879
Up firefox-official(44.0.1)
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Tue Feb 09 00:13:07 2016 +0200 (2016-02-09) |
parents | 95e0d6cca290 |
children | 7f188676b59c |
rev | line source |
---|---|
erjo@11941 | 1 #!/bin/sh |
erjo@11941 | 2 # /etc/init.d/nagios : Start, stop and restart ICAP server on SliTaz, at |
erjo@11941 | 3 # boot time or with the command line. |
erjo@11941 | 4 # |
erjo@11941 | 5 # To start ICAP server at boot time, just put c-icapd in the $RUN_DAEMONS |
erjo@11941 | 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf |
erjo@11941 | 7 # |
erjo@11941 | 8 . /etc/init.d/rc.functions |
erjo@11941 | 9 . /etc/daemons.conf |
erjo@11941 | 10 |
erjo@11941 | 11 NAME=c-icap |
erjo@11941 | 12 DESC="ICAP Server" |
erjo@11941 | 13 DAEMON=/usr/bin/c-icap |
erjo@11941 | 14 OPTIONS="" |
erjo@11941 | 15 PIDFILE=/var/run/c-icap/c-icap.pid |
erjo@11941 | 16 |
pascal@16681 | 17 [ -d /var/run/c-icap ] || mkdir -p /var/run/c-icap |
erjo@11941 | 18 case "$1" in |
erjo@11941 | 19 start) |
erjo@11941 | 20 if active_pidfile $PIDFILE $NAME ; then |
erjo@11941 | 21 echo "$NAME already running." |
erjo@11941 | 22 exit 1 |
erjo@11941 | 23 fi |
erjo@11941 | 24 echo -n "Starting $DESC: $NAME... " |
erjo@11941 | 25 $DAEMON $OPTIONS |
erjo@11941 | 26 status |
erjo@11941 | 27 ;; |
erjo@11941 | 28 stop) |
erjo@11941 | 29 if ! active_pidfile $PIDFILE $NAME ; then |
erjo@11941 | 30 echo "$NAME is not running." |
erjo@11941 | 31 exit 1 |
erjo@11941 | 32 fi |
erjo@11941 | 33 echo -n "Stopping $DESC: $NAME... " |
erjo@11941 | 34 kill `cat $PIDFILE` |
erjo@11941 | 35 status |
erjo@11941 | 36 ;; |
erjo@11941 | 37 restart|reload) |
erjo@11941 | 38 if ! active_pidfile $PIDFILE $NAME ; then |
erjo@11941 | 39 echo "$NAME is not running." |
erjo@11941 | 40 exit 1 |
erjo@11941 | 41 fi |
erjo@11941 | 42 echo -n "Restarting $DESC: $NAME... " |
erjo@11941 | 43 kill `cat $PIDFILE` |
erjo@11941 | 44 sleep 2 |
erjo@11941 | 45 $DAEMON $OPTIONS |
erjo@11941 | 46 status |
erjo@11941 | 47 ;; |
erjo@11941 | 48 test) |
erjo@11941 | 49 configtest ;; |
erjo@11941 | 50 *) |
erjo@11941 | 51 echo "" |
erjo@11941 | 52 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart|reload]" |
erjo@11941 | 53 echo "" |
erjo@11941 | 54 exit 1 |
erjo@11941 | 55 ;; |
erjo@11941 | 56 esac |
erjo@11941 | 57 |
erjo@11941 | 58 exit 0 |