From: arne_f Date: Wed, 5 Mar 2008 17:08:22 +0000 (+0000) Subject: fix service.cgi hangs if the initscript of an addon dosn't close output X-Git-Tag: v2.3-beta1~157 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=08efdb4f268f2d7489da9e1ac063f8418ffc8ad9;p=ipfire-2.x.git fix service.cgi hangs if the initscript of an addon dosn't close output improved sanedloop and sane initscript git-svn-id: http://svn.ipfire.org/svn/ipfire/branches/2.1/trunk@1251 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- diff --git a/html/cgi-bin/services.cgi b/html/cgi-bin/services.cgi index d585135397..c7314be926 100644 --- a/html/cgi-bin/services.cgi +++ b/html/cgi-bin/services.cgi @@ -117,7 +117,7 @@ print "\n"; my $paramstr=$ENV{QUERY_STRING}; my @param=split(/!/, $paramstr); if ($param[1] ne '') { - my $temp = `/usr/local/bin/addonctrl @param[0] @param[1]`; + system("/usr/local/bin/addonctrl @param[0] @param[1] > /dev/null 2>&1"); } print < /dev/null 2>&1 - killall -s KILL -w saned > /dev/null 2>&1 - /usr/local/bin/sanedloop & + loadproc /usr/local/bin/sanedloop evaluate_retval ;; stop) boot_mesg "Stopping saned - network scanner deamon..." - killall -s KILL -w sanedloop > /dev/null 2>&1 + killproc sanedloop killall -s KILL -w saned > /dev/null 2>&1 - echo_ok + exit 0 ;; restart) + ${0} stop + sleep 1 ${0} start ;; diff --git a/src/scripts/sanedloop b/src/scripts/sanedloop index f29425af4b..2b02903ecb 100644 --- a/src/scripts/sanedloop +++ b/src/scripts/sanedloop @@ -2,7 +2,4 @@ # # saned is intended for use with (x)inet.d so we have to recall it in a loop # -while true; -do - /usr/sbin/saned -s0; -done; +(while true; do /usr/sbin/saned -s0; done) &