wok-6.x annotate hal/stuff/etc/init.d/hald @ rev 3561
Add: mingw32
author | Matthew Sheets <rcx@zoominternet.net> |
---|---|
date | Wed Jun 24 10:32:56 2009 +0000 (2009-06-24) |
parents | 274ea51cd553 |
children | e7971445ddec |
rev | line source |
---|---|
pankso@792 | 1 #!/bin/sh |
pankso@792 | 2 # /etc/init.d/hald: Start, stop and restart HAL daemon on SliTaz, |
pankso@792 | 3 # at boot time or with the command line. Daemons options are configured |
pankso@792 | 4 # with /etc/daemons.conf |
pankso@792 | 5 # |
pankso@792 | 6 . /etc/init.d/rc.functions |
pankso@792 | 7 . /etc/daemons.conf |
pankso@792 | 8 |
pankso@792 | 9 NAME=HAL |
pankso@792 | 10 DESC="Hardware Abstraction Layer" |
pankso@792 | 11 DAEMON=/usr/sbin/hald |
pankso@792 | 12 OPTIONS=$HALD_OPTIONS |
pankso@792 | 13 PIDFILE=/var/run/hald/pid |
pankso@792 | 14 |
pankso@792 | 15 case "$1" in |
pankso@792 | 16 start) |
pascal@2396 | 17 if active_pidfile $PIDFILE hald ; then |
pankso@792 | 18 echo "$NAME already running." |
pankso@792 | 19 exit 1 |
pankso@792 | 20 fi |
pankso@792 | 21 echo -n "Starting $DESC: $NAME... " |
pankso@792 | 22 $DAEMON $OPTIONS |
pankso@792 | 23 status |
pankso@792 | 24 ;; |
pankso@792 | 25 stop) |
pascal@2396 | 26 if ! active_pidfile $PIDFILE hald ; then |
pankso@792 | 27 echo "$NAME is not running." |
pankso@792 | 28 exit 1 |
pankso@792 | 29 fi |
pankso@792 | 30 echo -n "Stopping $DESC: $NAME... " |
pankso@792 | 31 kill `cat $PIDFILE` |
pankso@792 | 32 rm $PIDFILE |
pankso@792 | 33 status |
pankso@792 | 34 ;; |
pankso@792 | 35 restart) |
pascal@2396 | 36 if ! active_pidfile $PIDFILE hald ; then |
pankso@792 | 37 echo "$NAME is not running." |
pankso@792 | 38 exit 1 |
pankso@792 | 39 fi |
pankso@792 | 40 echo -n "Restarting $DESC: $NAME... " |
pankso@792 | 41 kill `cat $PIDFILE` |
pankso@792 | 42 rm $PIDFILE |
pankso@792 | 43 sleep 2 |
pankso@792 | 44 $DAEMON $OPTIONS |
pankso@792 | 45 status |
pankso@792 | 46 ;; |
pankso@792 | 47 *) |
pankso@792 | 48 echo "" |
pankso@792 | 49 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" |
pankso@792 | 50 echo "" |
pankso@792 | 51 exit 1 |
pankso@792 | 52 ;; |
pankso@792 | 53 esac |
pankso@792 | 54 |
pankso@792 | 55 exit 0 |