Fix to ensure systemd is the active init system #2022
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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 .."
|
||||
|
||||
Reference in New Issue
Block a user