mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
Fix to save status of service correctly [build]
This commit is contained in:
@@ -11,6 +11,10 @@ $< == 0 || die "updateboot.pl must be run as root";
|
||||
# Update boot script
|
||||
if ($product) {
|
||||
if ($init_mode eq "systemd") {
|
||||
# Save status of service
|
||||
my $status = &backquote_logged("systemctl is-enabled ".
|
||||
quotemeta($product).".service 2>&1");
|
||||
$status = &trim($status) if ($status);
|
||||
# Delete all possible service files
|
||||
my $systemd_root = &get_systemd_root();
|
||||
foreach my $p (
|
||||
@@ -30,10 +34,6 @@ if ($product) {
|
||||
}
|
||||
&flush_file_lines($temp);
|
||||
|
||||
my $status = &backquote_logged("systemctl is-enabled ".
|
||||
quotemeta($product).".service 2>&1");
|
||||
$status = &trim($status);
|
||||
|
||||
copy_source_dest($temp, "$systemd_root/$product.service");
|
||||
system("systemctl daemon-reload >/dev/null 2>&1");
|
||||
sleep(3); # Wait for systemd to update configuration
|
||||
|
||||
Reference in New Issue
Block a user