diff options
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/hal/files/hald.in | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sysutils/hal/files/hald.in b/sysutils/hal/files/hald.in index 0629cf0f2..aefba2194 100644 --- a/sysutils/hal/files/hald.in +++ b/sysutils/hal/files/hald.in @@ -24,16 +24,30 @@ pidfile="/var/run/${name}/${name}.pid" stop_postcmd="hald_postcmd" start_precmd="hald_precmd" +local_force_depend() +{ + _depend="$1" + if [ -f %%LOCALBASE%%/etc/rc.d/${_depend}.sh ]; then + _depend="${_depend}.sh" + fi + + if ! %%LOCALBASE%%/etc/rc.d/${_depend} forcestatus 1>/dev/null 2>&1 && + ! %%LOCALBASE%%/etc/rc.d/${_depend} forcestart; then + return 1 + fi + return 0 +} + hald_precmd() { if ! checkyesno dbus_enable then - force_depend dbus || return 1 + local_force_depend dbus || return 1 fi if ! checkyesno polkitd_enable then - force_depend polkitd || return 1 + local_force_depend polkitd || return 1 fi mkdir -p $(dirname $pidfile) |