wok-6.x annotate smartmontools/stuff/etc/init.d/smartd @ rev 10640
icedtea6-jdk: add small comment
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri May 27 00:58:14 2011 +0200 (2011-05-27) |
parents | 6a9428a46323 |
children | 7f188676b59c |
rev | line source |
---|---|
erjo@621 | 1 #!/bin/sh |
erjo@621 | 2 # /etc/init.d/smartd : Start, stop and restart Smartmontools (SMART) daemon on SliTaz, at |
erjo@621 | 3 # boot time or with the command line. |
erjo@621 | 4 # |
erjo@621 | 5 # To start SMART monitoring at boot time, just put smartd in the $RUN_DAEMONS |
erjo@621 | 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf |
erjo@621 | 7 # |
erjo@621 | 8 . /etc/init.d/rc.functions |
erjo@621 | 9 . /etc/daemons.conf |
erjo@621 | 10 |
erjo@621 | 11 NAME=smartd |
erjo@621 | 12 DESC="Smartmontools (SMART) Daemon" |
erjo@621 | 13 DAEMON=/usr/sbin/smartd |
erjo@621 | 14 |
erjo@621 | 15 PIDFILE=/var/run/smartd.pid |
erjo@621 | 16 OPTIONS="-p $PIDFILE" |
erjo@621 | 17 |
erjo@621 | 18 case "$1" in |
erjo@621 | 19 start) |
pascal@6170 | 20 if active_pidfile $PIDFILE smartd ; then |
erjo@621 | 21 echo "$NAME already running." |
erjo@621 | 22 exit 1 |
erjo@621 | 23 fi |
erjo@621 | 24 echo -n "Starting $DESC: $NAME... " |
erjo@621 | 25 $DAEMON $OPTIONS |
erjo@621 | 26 status |
erjo@621 | 27 ;; |
erjo@621 | 28 stop) |
pascal@6170 | 29 if ! active_pidfile $PIDFILE smartd ; then |
erjo@621 | 30 echo "$NAME is not running." |
erjo@621 | 31 exit 1 |
erjo@621 | 32 fi |
erjo@621 | 33 echo -n "Stopping $DESC: $NAME... " |
erjo@621 | 34 kill `cat $PIDFILE` |
erjo@621 | 35 status |
erjo@621 | 36 ;; |
erjo@621 | 37 restart) |
pascal@6170 | 38 if ! active_pidfile $PIDFILE smartd ; then |
erjo@621 | 39 echo "$NAME is not running." |
erjo@621 | 40 exit 1 |
erjo@621 | 41 fi |
erjo@621 | 42 echo -n "Restarting $DESC: $NAME... " |
erjo@621 | 43 kill `cat $PIDFILE` |
erjo@621 | 44 sleep 2 |
erjo@621 | 45 $DAEMON $OPTIONS |
erjo@621 | 46 status |
erjo@621 | 47 ;; |
erjo@621 | 48 *) |
erjo@621 | 49 echo "" |
erjo@621 | 50 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" |
erjo@621 | 51 echo "" |
erjo@621 | 52 exit 1 |
erjo@621 | 53 ;; |
erjo@621 | 54 esac |
erjo@621 | 55 |
erjo@621 | 56 exit 0 |