Skip to content

Commit

Permalink
Fix to call update boot script after adding boot #2133 [build]
Browse files Browse the repository at this point in the history
  • Loading branch information
iliajie committed Apr 21, 2024
1 parent f180420 commit 985129b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
13 changes: 4 additions & 9 deletions setup.pl
Original file line number Diff line number Diff line change
Expand Up @@ -765,15 +765,6 @@
chmod(0755, "$config_directory/reload");
chmod(0755, "$config_directory/.pre-install");
chmod(0755, "$config_directory/.post-install");

# Fix existing systemd webmin.service file to update start and stop commands
chdir("$wadir/init");
system("$perl ".&quote_path("$wadir/init/updateboot.pl")." $bootscript");
}
else {
# Try to install init script to init.d
chdir("$wadir/init");
system("$perl ".&quote_path("$wadir/init/updateboot.pl")." $bootscript");
}
}
print ".. done\n";
Expand Down Expand Up @@ -837,6 +828,7 @@
# Set the product field in the global config
$gconfig{'product'} ||= "webmin";

# Add boot script if needed
if ($makeboot) {
print "Configuring Webmin to start at boot time ..\n";
chdir("$wadir/init");
Expand All @@ -845,6 +837,9 @@
print "\n";
}

# Update boot script if needed
chdir("$wadir/init");
system("$perl ".&quote_path("$wadir/init/updateboot.pl")." $bootscript");

# If password delays are not specifically disabled, enable them
if (!defined($miniserv{'passdelay'}) && $os_type ne 'windows') {
Expand Down
7 changes: 4 additions & 3 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,6 @@ if [ -x "$systemctlcmd" ]; then
chmod 755 $config_dir/stop $config_dir/start $config_dir/restart $config_dir/restart-by-force-kill $config_dir/reload $config_dir/.pre-install $config_dir/.post-install
fi

# Fix existing systemd webmin.service file to update start and stop commands
(cd "$wadir/init" ; WEBMIN_CONFIG=$config_dir WEBMIN_VAR=$var_dir "$wadir/init/updateboot.pl" "$bootscript")

if [ "$upgrading" = 1 -a "$inetd" != "1" -a "$nostop" = "" ]; then
# Stop old version, with updated stop script
$config_dir/.pre-install >/dev/null 2>&1
Expand Down Expand Up @@ -898,13 +895,17 @@ if [ "$?" != "0" ]; then
echo product=webmin >> $config_dir/config
fi

# Add boot script if needed
if [ "$makeboot" = "1" ]; then
echo "Configuring Webmin to start at boot time .."
(cd "$wadir/init" ; WEBMIN_CONFIG=$config_dir WEBMIN_VAR=$var_dir "$wadir/init/atboot.pl" $bootscript)
echo ".. done"
echo ""
fi

# Update boot script if needed
(cd "$wadir/init" ; WEBMIN_CONFIG=$config_dir WEBMIN_VAR=$var_dir "$wadir/init/updateboot.pl" "$bootscript")

# If password delays are not specifically disabled, enable them
grep passdelay= $config_dir/miniserv.conf >/dev/null
if [ "$?" != "0" ]; then
Expand Down

0 comments on commit 985129b

Please sign in to comment.