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