diff --git a/init/edit_systemd.cgi b/init/edit_systemd.cgi
index 8d3f3a43a..f04526460 100755
--- a/init/edit_systemd.cgi
+++ b/init/edit_systemd.cgi
@@ -80,7 +80,8 @@ else {
[ 'start', $text{'edit_startnow'} ],
[ 'restart', $text{'edit_restartnow'} ],
[ 'stop', $text{'edit_stopnow'} ],
- [ 'delete', $text{'delete'} ] ]);
+ $in{'name'} eq 'webmin.service' ?
+ undef : [ 'delete', $text{'delete'} ] ]);
}
&ui_print_footer("", $text{'index_return'});
diff --git a/init/lang/en b/init/lang/en
index cf4a92876..baedf6f53 100644
--- a/init/lang/en
+++ b/init/lang/en
@@ -162,6 +162,7 @@ edit_hostconfig_title=Edit Hostconfig
mass_enone=No actions selected
mass_enone2=No services selected
+mass_enoallow=cannot stop $1
mass_start=Starting Actions
mass_restart=Restarting Actions
mass_stop=Stopping Actions
@@ -171,6 +172,7 @@ mass_disable=Disabling action $1 at boot time.
mass_starting=Starting action $1 ..
mass_stopping=Stopping action $1 ..
mass_failed=.. failed
+mass_skipped=.. skipped
mass_ok=.. done
mass_ustart=Starting Services
mass_urestart=Restarting Services
diff --git a/init/mass_systemd.cgi b/init/mass_systemd.cgi
index c9eb8f76f..139da70f6 100755
--- a/init/mass_systemd.cgi
+++ b/init/mass_systemd.cgi
@@ -21,16 +21,30 @@ if ($stop || $restart) {
$access{'bootup'} || &error($text{'ss_ecannot'});
$SIG{'TERM'} = 'ignore'; # Restarting webmin may kill this script
foreach $s (@sel) {
+ my ($ok, $out);
+ my $is_webmin = $s eq 'webmin.service';
if ($stop) {
print &text('mass_ustopping', "$s"),"
\n";
- ($ok, $out) = &stop_action($s);
+ ($ok, $out) = &stop_action($s)
+ if (!$is_webmin);
}
elsif ($restart) {
print &text('mass_urestarting', "$s"),"
\n";
- ($ok, $out) = &restart_action($s);
+ if (!$is_webmin) {
+ ($ok, $out) = &restart_action($s);
+ }
+ else {
+ &restart_miniserv();
+ }
}
print "
$out" if ($out); - if (!$ok) { + if ($is_webmin) { + print "$text{'mass_skipped'} : ". &text('mass_enoallow', $s),"\n" + if ($stop); + print $text{'mass_ok'},"\n" + if ($restart); + } + elsif (!$ok) { print $text{'mass_failed'},"\n"; } else {