Skip to content

Commit

Permalink
Fix to save status of service correctly [build]
Browse files Browse the repository at this point in the history
  • Loading branch information
iliajie committed Apr 21, 2024
1 parent 975ae7b commit 1f2a790
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions init/updateboot.pl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
# 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 (
Expand All @@ -30,10 +34,6 @@
}
&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
Expand Down

0 comments on commit 1f2a790

Please sign in to comment.