diff options
Diffstat (limited to 'meta/recipes-support/hal/files/20hal')
-rwxr-xr-x | meta/recipes-support/hal/files/20hal | 58 |
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 | |||
12 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
13 | DAEMON=/usr/sbin/hald | ||
14 | PIDDIR=/var/run/hald | ||
15 | PIDFILE=$PIDDIR/hald.pid | ||
16 | NAME=hald | ||
17 | DAEMONUSER=haldaemon | ||
18 | DESC="Hardware abstraction layer" | ||
19 | |||
20 | test -x $DAEMON || exit 0 | ||
21 | |||
22 | set -e | ||
23 | |||
24 | do_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 | |||
34 | do_stop() { | ||
35 | echo "Stopping $DESC" "$NAME" | ||
36 | start-stop-daemon --stop --quiet --pidfile $PIDFILE \ | ||
37 | --exec $DAEMON | ||
38 | } | ||
39 | |||
40 | case "$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 | ;; | ||
56 | esac | ||
57 | |||
58 | exit 0 | ||