From ef0d07f55b9168a7d9b068803699a1e263cab796 Mon Sep 17 00:00:00 2001 From: Ilia Rostovtsev Date: Sun, 6 Feb 2022 21:03:59 +0300 Subject: [PATCH] Fix systemd service detection https://github.com/virtualmin/virtualmin-pro/issues/16#issuecomment-1030869911 --- init/init-lib.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init/init-lib.pl b/init/init-lib.pl index b872aa1cb..03d4f7dcb 100755 --- a/init/init-lib.pl +++ b/init/init-lib.pl @@ -2377,7 +2377,8 @@ sub is_systemd_service { my ($name) = @_; foreach my $s (&list_systemd_services(1)) { - if ($s->{'name'} eq $name && !$s->{'legacy'}) { + if (($s->{'name'} eq $name || + $s->{'name'} eq "$name.service") && !$s->{'legacy'}) { return 1; } }