diff --git a/init/init-lib.pl b/init/init-lib.pl index 24376870c..a659e6b27 100755 --- a/init/init-lib.pl +++ b/init/init-lib.pl @@ -546,6 +546,17 @@ elsif ($init_mode eq "systemd") { # Exists .. but is it started at boot? return lc($1) eq 'enabled' || lc($1) eq 'static' ? 2 : 1; } + else { + my $out = &backquote_command("systemctl is-enabled ". + quotemeta($unit)." 2>&1"); + if ($out =~ /no such file/i) { + return 0; + } + else { + $out =~ s/^\s+|\s+$//g; + return $out eq 'enabled' ? 2 : 1; + } + } } if ($init_mode eq "init" || $init_mode eq "upstart" || $init_mode eq "systemd") {