wok view hal/stuff/etc/init.d/hald @ rev 1934
Sylpheed upgrade to 2.6.0
author | hacker@aspic |
---|---|
date | Thu Dec 25 22:53:06 2008 +0100 (2008-12-25) |
parents | |
children | f34a5fddcf70 |
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 [ -f $PIDFILE ] ; 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 [ ! -f $PIDFILE ] ; 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 [ ! -f $PIDFILE ] ; 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