wok annotate rsync/stuff/etc/init.d/rsyncd @ rev 10813
mysql: fix perms.
author | Eric Joseph-Alexandre <erjo@slitaz.org> |
---|---|
date | Sun Jun 05 20:03:48 2011 +0200 (2011-06-05) |
parents | 580279b0298b |
children | 7f188676b59c |
rev | line source |
---|---|
pankso@8 | 1 #!/bin/sh |
pankso@8 | 2 # /etc/init.d/rsyncd: Start, stop and restart Rsync deamon on SliTaz, at boot |
pankso@8 | 3 # time or with the command line. |
pankso@8 | 4 # |
pankso@8 | 5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS |
pankso@8 | 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf. |
pankso@8 | 7 # |
pankso@8 | 8 . /etc/init.d/rc.functions |
pankso@8 | 9 . /etc/daemons.conf |
pankso@8 | 10 |
pankso@8 | 11 NAME=Rsyncd |
pankso@8 | 12 DESC="rsync deamon" |
pankso@8 | 13 DAEMON=/usr/bin/rsync |
pankso@8 | 14 OPTIONS=$RSYNCD_OPTIONS |
pankso@8 | 15 PIDFILE=/var/run/rsyncd.pid |
pankso@8 | 16 |
pankso@8 | 17 case "$1" in |
pankso@8 | 18 start) |
pascal@2404 | 19 if active_pidfile $PIDFILE rsync ; then |
pankso@8 | 20 echo "$NAME already running." |
pankso@8 | 21 exit 1 |
pankso@8 | 22 fi |
pankso@8 | 23 echo -n "Starting $DESC: $NAME... " |
pankso@8 | 24 $DAEMON $OPTIONS |
pankso@8 | 25 status |
pankso@8 | 26 ;; |
pankso@8 | 27 stop) |
pascal@2404 | 28 if ! active_pidfile $PIDFILE rsync ; then |
pankso@8 | 29 echo "$NAME is not running." |
pankso@8 | 30 exit 1 |
pankso@8 | 31 fi |
pankso@8 | 32 echo -n "Stopping $DESC: $NAME... " |
pankso@8 | 33 kill `cat $PIDFILE` |
pankso@8 | 34 rm $PIDFILE |
pankso@8 | 35 status |
pankso@8 | 36 ;; |
pankso@8 | 37 restart) |
pascal@2404 | 38 if ! active_pidfile $PIDFILE rsync ; then |
pankso@8 | 39 echo "$NAME is not running." |
pankso@8 | 40 exit 1 |
pankso@8 | 41 fi |
pankso@8 | 42 echo -n "Restarting $DESC: $NAME... " |
pankso@8 | 43 kill `cat $PIDFILE` |
pankso@8 | 44 rm $PIDFILE |
pankso@8 | 45 sleep 2 |
pankso@8 | 46 $DAEMON $OPTIONS |
pankso@8 | 47 status |
pankso@8 | 48 ;; |
pankso@8 | 49 *) |
pankso@8 | 50 echo "" |
pankso@8 | 51 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" |
pankso@8 | 52 echo "" |
pankso@8 | 53 exit 1 |
pankso@8 | 54 ;; |
pankso@8 | 55 esac |
pankso@8 | 56 |
pankso@8 | 57 exit 0 |