Fix to ensure systemd is the active init system #2022

This commit is contained in:
Ilia Ross
2023-10-11 18:43:47 +03:00
parent 2e63031e22
commit 873490367d
2 changed files with 13 additions and 1 deletions
+6
View File
@@ -554,6 +554,12 @@ if (!$ENV{'noperlpath"'} && $os_type ne 'windows') {
print "\n";
}
my $systemctlcmd = &has_command('systemctl');
if (-x $systemctlcmd) {
my $initsys = &trim(&backquote_command("cat /proc/1/comm 2>/dev/null"));
if ($initsys ne 'systemd') {
$systemctlcmd = undef;
}
}
print "Creating start and stop scripts ..\n";
if ($os_type eq "windows") {
open(START, ">>$config_directory/start.bat");
+7 -1
View File
@@ -661,7 +661,13 @@ if [ ! -f "$config_dir/.pre-install" ]; then
fi
# Test if we have systemd system
systemctlcmd=`which systemctl 2>/dev/null`
systemctlcmd=$(which systemctl 2>/dev/null)
if [ -x "$systemctlcmd" ]; then
initsys=$(cat /proc/1/comm 2>/dev/null)
if [ "$initsys" != "systemd" ]; then
systemctlcmd=""
fi
fi
# Re-generating main scripts
echo "Creating start and stop init scripts .."