wok annotate partimage/stuff/etc/init.d/partimaged @ rev 4208

Fix: tazbb clean_up build wok
author Christophe Lincoln <pankso@slitaz.org>
date Thu Sep 24 09:51:12 2009 +0200 (2009-09-24)
parents
children ba5507fa22f8
rev   line source
erjo@582 1 #!/bin/sh
erjo@582 2 # /etc/init.d/unfsd : Start, stop and restart Partimage Server on SliTaz, at
erjo@582 3 # boot time or with the command line.
erjo@582 4 #
erjo@582 5 # To start Partimage Server at boot time, just put Partimage in the $RUN_DAEMONS
erjo@582 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
erjo@582 7 #
erjo@582 8 . /etc/init.d/rc.functions
erjo@582 9 . /etc/daemons.conf
erjo@582 10
erjo@582 11 NAME=partimaged
erjo@582 12 DESC="Partimage Server"
erjo@582 13 DAEMON=/usr/sbin/partimaged
erjo@582 14 IMAGES_DIR=/var/lib/partimaged
erjo@582 15 OPTIONS="-D -d ${IMAGES_DIR}"
erjo@582 16 PIDFILE=/var/run/$NAME.pid
erjo@582 17
erjo@582 18
erjo@582 19 test -f $DAEMON || exit 0
erjo@582 20
erjo@582 21
erjo@582 22
erjo@582 23 case "$1" in
erjo@582 24 start)
erjo@582 25 if [ -f $PIDFILE ] ; then
erjo@582 26 echo "$NAME already running."
erjo@582 27 exit 1
erjo@582 28 fi
erjo@582 29
erjo@582 30 check_conf
erjo@582 31 echo -n "Starting $DESC: $NAME... "
erjo@582 32 $DAEMON $OPTIONS
erjo@582 33 status
erjo@582 34
erjo@582 35 # registering PID
erjo@582 36 if [ $? -eq 0 ]; then
erjo@582 37 pidof -s $NAME > $PIDFILE
erjo@582 38 fi
erjo@582 39 ;;
erjo@582 40 stop)
erjo@582 41 if [ ! -f $PIDFILE ] ; then
erjo@582 42 echo "$NAME is not running."
erjo@582 43 exit 1
erjo@582 44 fi
erjo@582 45 echo -n "Stopping $DESC: $NAME... "
erjo@582 46 kill `cat $PIDFILE`
erjo@582 47 rm -f $PIDFILE
erjo@582 48 status
erjo@582 49 ;;
erjo@582 50 restart)
erjo@582 51 $0 stop
erjo@582 52 $0 start
erjo@582 53 ;;
erjo@582 54 *)
erjo@582 55 echo "Usage: $DAEMON {start|stop|reload|restart}"
erjo@582 56 exit 1
erjo@582 57 ;;
erjo@582 58 esac
erjo@582 59
erjo@582 60 exit 0
erjo@582 61