summaryrefslogtreecommitdiffstats
path: root/extra/hal/haldaemon
blob: 64affe7cf8064604f3bb70732f4ff616b5c8a884 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
# Begin $rc_base/init.d/haldaemon

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

#$LastChangedBy: randy $
#$Date: 2007/09/27 15:12:01 $
# $Id: haldaemon,v 1.1 2007/09/27 15:12:01 install Exp $
. /etc/sysconfig/rc
. $rc_functions
newid=19
newuser=haldaemon
newgroup=haldaemon
getent group $newgroup > /dev/null || /usr/sbin/groupadd -g $newid $newgroup
getent passwd $newuser > /dev/null || /usr/sbin/useradd -g $newgroup \
-u $newid -s /bin/false -d /dev/null -u $newid -c "HAL Daemon User" $newuser
getent group halusers > /dev/null || /usr/sbin/groupadd -g 61 halusers

case "$1" in
	start)
		boot_mesg "Starting the HAL Daemon..."
		loadproc /usr/sbin/hald --use-syslog
		;;

	stop)
		boot_mesg "Stopping the HAL Daemon..."
		killproc /usr/sbin/hald
		;;

	restart)
		$0 stop
		sleep 1
		$0 start
		;;

	status)
		statusproc /usr/sbin/hald
		;;

	*)
		echo "Usage: $0 {start|stop|restart|status}"
		exit 1
		;;
esac

# End $rc_base/init.d/haldaemon