#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/files/0.5.10-hald.rc,v 1.2 2008/01/05 19:23:08 compnerd Exp $

depend() {
	use logger acpid
	need dbus
	after coldplug dns nscd
}

start() {
	[ -z "${HALD_VERBOSE}" ] && HALD_VERBOSE="no"
	ebegin "Starting Hardware Abstraction Layer daemon"

	if [ -f /proc/acpi/event ]; then
		chgrp haldaemon /proc/acpi/event
		chmod 440 /proc/acpi/event
	fi

	start-stop-daemon --start -q --exec /usr/sbin/hald -- --use-syslog --verbose=${HALD_VERBOSE}
	eend $?
}

stop() {
	ebegin "Stopping Hardware Abstraction Layer daemon"
	start-stop-daemon --stop -q --pidfile /var/run/hald.pid
	eend $?
}
