From 08efdb4f268f2d7489da9e1ac063f8418ffc8ad9 Mon Sep 17 00:00:00 2001 From: arne_f Date: Wed, 5 Mar 2008 17:08:22 +0000 Subject: [PATCH] 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 --- html/cgi-bin/services.cgi | 2 +- src/initscripts/init.d/sane | 10 +++++----- src/scripts/sanedloop | 5 +---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/html/cgi-bin/services.cgi b/html/cgi-bin/services.cgi index d58513539..c7314be92 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 f29425af4..2b02903ec 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) &