3 # Start or stop a boot-time action
5 require './init-lib.pl';
6 &foreign_require("proc", "proc-lib.pl");
7 $access{'bootup'} || &error($text{'ss_ecannot'});
10 # Work out the correct command, and show header
13 foreach $a ('start', 'restart', 'condrestart', 'reload', 'status', 'stop') {
14 if (defined($in{$a})) {
19 &ui_print_header(undef, $text{'ss_'.$action}, "");
20 $cmd = $in{'file'}." ".$action;
22 # In case the action was Webmin
23 $SIG{'TERM'} = sub { };
26 print &text('ss_exec', "<tt>$cmd</tt>"),"<p>\n";
28 &foreign_call("proc", "safe_process_exec_logged", $cmd, 0, 0, STDOUT, undef, 1);
30 &webmin_log($action, 'action', $in{'name'});
32 &ui_print_footer($in{'back'}, $text{'edit_return'});