Prevent Webmin from killing itself on a restart
authorJamie Cameron <jcameron@webmin.com>
Mon, 25 Aug 2008 18:18:53 +0000 (18:18 +0000)
committerJamie Cameron <jcameron@webmin.com>
Mon, 25 Aug 2008 18:18:53 +0000 (18:18 +0000)
init/mass_start_stop.cgi
init/start_stop.cgi

index 345d0cc..7802fe5 100755 (executable)
@@ -17,6 +17,9 @@ $disable = 1 if ($in{'delboot'} || $in{'delboot_stop'});
                                   $restart ? $text{'mass_restart'} :
                                              $text{'mass_stop'}, "");
 
+# In case the action was Webmin
+$SIG{'TERM'} = 'IGNORE';
+
 if ($start || $stop || $restart) {
        # Starting or stopping a bunch of actions
        &foreign_require("proc", "proc-lib.pl");
index fd5e57b..6794403 100755 (executable)
@@ -7,6 +7,7 @@ require './init-lib.pl';
 $access{'bootup'} || &error($text{'ss_ecannot'});
 &ReadParse();
 
+# Work out the correct command, and show header
 $| = 1;
 $theme_no_header = 1;
 if (defined($in{'start'})) {
@@ -33,10 +34,16 @@ else {
        &ui_print_header(undef, $text{'ss_stop'}, "");
        $cmd = "$in{'file'} stop";
        }
+
+# In case the action was Webmin
+$SIG{'TERM'} = 'IGNORE';
+
+# Run the command
 print &text('ss_exec', "<tt>$cmd</tt>"),"<p>\n";
 print "<pre>";
 &foreign_call("proc", "safe_process_exec_logged", $cmd, 0, 0, STDOUT, undef, 1);
 print "</pre>\n";
 &webmin_log($in{'start'} ? 'start' : 'stop', 'action', $in{'name'});
+
 &ui_print_footer($in{'back'}, $text{'edit_return'});