diff --git a/setup.pl b/setup.pl index 0a06fe1e6..0c4c898d8 100755 --- a/setup.pl +++ b/setup.pl @@ -708,6 +708,7 @@ else { symlink("$config_directory/.reload-init", "$config_directory/reload"); # For systemd + my $perl = &get_perl_path(); if (-x $systemctlcmd) { # Clear existing @@ -766,10 +767,14 @@ else { chmod(0755, "$config_directory/.post-install"); # Fix existing systemd webmin.service file to update start and stop commands - my $perl = &get_perl_path(); chdir("$wadir/init"); system("$perl "."e_path("$wadir/init/updateboot.pl")." $bootscript"); - } + } + else { + # Try to install init script to init.d + chdir("$wadir/init"); + system("$perl "."e_path("$wadir/init/updateboot.pl")." $bootscript"); + } } print ".. done\n"; print "\n"; diff --git a/setup.sh b/setup.sh index e63eb3f95..a98b1d574 100755 --- a/setup.sh +++ b/setup.sh @@ -797,6 +797,7 @@ if [ -x "$systemctlcmd" ]; then else # Creating symlinks echo "Creating start and stop init symlinks to scripts .." + (cd "$wadir/init" ; WEBMIN_CONFIG=$config_dir WEBMIN_VAR=$var_dir "$wadir/init/updateboot.pl" "$bootscript") fi echo ".. done" echo ""