#!/bin/sh
# Begin /etc/init.d/haldaemon

### BEGIN INIT INFO
# Provides:            haldaemon
# Required-Start:      dbus
# Should-Start:        $remote_fs
# Required-Stop:       dbus
# Should-Stop:         $remote_fs
# Default-Start:       3 4 5 
# Default-Stop:        0 1 2 6
# Short-Description:   Starts/Stops the D-Bus Messagebus daemon.
# Description:         Starts and stops the D-Bus Messagebus daemon.
# X-LFS-Provided-By:   BLFS
### END INIT INFO

. /lib/lsb/init-functions

MESSAGE="the HAL Daemon..."
BIN_FILE="/usr/sbin/hald"
PIDFILE="/var/run/hald/pid"
case "$1" in
	start)
		start_daemon "${BIN_FILE}" --use-syslog
                evaluate_retval start
		;;

	stop)
		killproc -p "${PIDFILE}" "${BIN_FILE}"
                evaluate_retval stop
		;;

	restart)
		killproc -p "${PIDFILE}" "${BIN_FILE}" &&
		sleep 1 &&
		start_daemon "${BIN_FILE}" --use-syslog
                evaluate_retval restart
		;;

	status)
		statusproc "${BIN_FILE}"
		;;

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

# End /etc/init.d/haldaemon
