wok view hal/stuff/etc/init.d/hald @ rev 3973

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