diff -r 198005e4aad2 -r 4ca17af53013 dhcpd/rc.dhcpd --- a/dhcpd/rc.dhcpd Thu Sep 15 11:03:52 2011 +0200 +++ b/dhcpd/rc.dhcpd Thu Sep 15 11:49:33 2011 +0200 @@ -18,7 +18,8 @@ dhcpd_pidfile="@l_prefix@/var/dhcpd/run/dhcpd.pid" dhcpd_leases="@l_prefix@/var/dhcpd/db/dhcpd.leases" dhcpd_signal () { - [ -f $dhcpd_pidfile ] && kill -$1 `cat $dhcpd_pidfile` + if [ ! -f $dhcpd_pidfile ]; then return 1; fi + kill -$1 `cat $dhcpd_pidfile` } dhcpd_start () { if [ ! -f $dhcpd_leases ]; then @@ -27,6 +28,7 @@ chown @l_susr@:@l_mgrp@ $dhcpd_leases fi local cmd="@l_prefix@/sbin/dhcpd" + cmd="$cmd -f" cmd="$cmd $dhcpd_flags" echo ".$dhcpd_flags" | grep -- -p >/dev/null 2>&1 if [ $? -ne 0 -a ".$dhcpd_port" != . ]; then @@ -35,14 +37,15 @@ if [ $# -gt 0 ]; then cmd="$cmd $@" fi - cmd="$cmd >/dev/null 2>&1" - eval $cmd + ( eval "nohup $cmd /dev/null 2>&1 &" + echo $! >$dhcpd_pidfile + ) >/dev/null 2>&1 } %status -u @l_susr@ -o dhcpd_usable="unknown" dhcpd_active="no" - dhcpd_start -q -t || dhcpd_usable="no" + @l_prefix@/sbin/dhcpd -q -t || dhcpd_usable="no" [ ".$dhcpd_if" = . ] && dhcpd_usable="no" rcService dhcpd enable yes && \ dhcpd_signal 0 && dhcpd_active="yes"