summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/hal/files/20hal
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-support/hal/files/20hal')
-rwxr-xr-xmeta/recipes-support/hal/files/20hal58
1 files changed, 58 insertions, 0 deletions
diff --git a/meta/recipes-support/hal/files/20hal b/meta/recipes-support/hal/files/20hal
new file mode 100755
index 0000000000..5b97c4f9e6
--- /dev/null
+++ b/meta/recipes-support/hal/files/20hal
@@ -0,0 +1,58 @@
1#! /bin/sh
2#
3# hal Start the Daemon that stores device informations
4# for the Hardware abstraction layer
5#
6# Written by Martin Waitz based on skeleton code
7# written by Miquel van Smoorenburg <miquels@cistron.nl>.
8# Modified for Debian
9# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
10#
11
12PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
13DAEMON=/usr/sbin/hald
14PIDDIR=/var/run/hald
15PIDFILE=$PIDDIR/hald.pid
16NAME=hald
17DAEMONUSER=haldaemon
18DESC="Hardware abstraction layer"
19
20test -x $DAEMON || exit 0
21
22set -e
23
24do_start() {
25 if [ ! -d $PIDDIR ]; then
26 mkdir -p $PIDDIR
27 chown $DAEMONUSER:$DAEMONUSER $PIDDIR
28 fi
29 echo "Starting $DESC" "$NAME"
30 start-stop-daemon --start --pidfile $PIDFILE \
31 --exec $DAEMON -- $DAEMON_OPTS
32}
33
34do_stop() {
35 echo "Stopping $DESC" "$NAME"
36 start-stop-daemon --stop --quiet --pidfile $PIDFILE \
37 --exec $DAEMON
38}
39
40case "$1" in
41 start)
42 do_start
43 ;;
44 stop)
45 do_stop
46 ;;
47 restart|force-reload)
48 do_stop
49 sleep 5
50 do_start
51 ;;
52 *)
53 echo "Usage: $0 {start|stop|restart|force-reload}" >&2
54 exit 1
55 ;;
56esac
57
58exit 0