aboutsummaryrefslogtreecommitdiff
path: root/sysutils/hal/files/hald.in
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/hal/files/hald.in')
-rw-r--r--sysutils/hal/files/hald.in26
1 files changed, 21 insertions, 5 deletions
diff --git a/sysutils/hal/files/hald.in b/sysutils/hal/files/hald.in
index ab906a516f30..7f8f2c659c86 100644
--- a/sysutils/hal/files/hald.in
+++ b/sysutils/hal/files/hald.in
@@ -3,7 +3,7 @@
# $FreeBSD$
#
# PROVIDE: hald
-# REQUIRE: DAEMON usbd devd dbus polkitd
+# REQUIRE: DAEMON usbd devd dbus
#
# Add the following line to /etc/rc.conf to enable the HAL daemon:
#
@@ -24,6 +24,7 @@ pidfile="/var/run/${name}/${name}.pid"
stop_postcmd="hald_postcmd"
start_precmd="hald_precmd"
+start_cmd="hald_start"
local_force_depend()
{
@@ -46,10 +47,7 @@ hald_precmd()
local_force_depend dbus || return 1
fi
- if ! checkyesno polkitd_enable
- then
- local_force_depend polkitd || return 1
- fi
+ chmod 0755 /var/cache
mkdir -p $(dirname $pidfile)
}
@@ -59,5 +57,23 @@ hald_postcmd()
rm -f $pidfile
}
+hald_start()
+{
+ if ! checkyesno hald_enable ; then
+ return 0
+ fi
+ echo "Starting ${name}."
+
+ ( iter=0
+ while ! ps -axoargs | grep "^/usr/libexec/getty " | grep -qv grep >/dev/null 2>&1; do
+ if [ ${iter} -eq 60 ]; then
+ break
+ fi
+ sleep 1
+ iter=$(expr ${iter} + 1)
+ done
+ ${command} ${hald_flags} ) &
+}
+
load_rc_config ${name}
run_rc_command "$1"