]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
fix service.cgi hangs if the initscript of an addon dosn't close output
authorarne_f <arne_f@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Wed, 5 Mar 2008 17:08:22 +0000 (17:08 +0000)
committerarne_f <arne_f@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Wed, 5 Mar 2008 17:08:22 +0000 (17:08 +0000)
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
src/initscripts/init.d/sane
src/scripts/sanedloop

index d585135397d63936cf631abb241d17bdbfe8eaeb..c7314be9264af45d99dbfd91f908f555875f35c1 100644 (file)
@@ -117,7 +117,7 @@ print "</table></div>\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 <<END
index 78adb84ec632adf8978f46d59bb469dc19bbf9f2..98303036b197a0d8d023940acc67bad162bdea3b 100644 (file)
 case "${1}" in
        start)
                boot_mesg "Starting saned - network scanner deamon..."
-               killall -s KILL -w sanedloop > /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
                ;;
 
index f29425af4b6e88f8ae435dfcb09aed4fd7c253a2..2b02903ecba537caec4440a5322a233acef33440 100644 (file)
@@ -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) &