diff --git a/makedebian.pl b/makedebian.pl index acda6bb7d..38f193440 100755 --- a/makedebian.pl +++ b/makedebian.pl @@ -265,8 +265,9 @@ open(SCRIPT, ">$postinstall_file"); print SCRIPT </etc/webmin/stop 2>/dev/null <<'EOD' #!/bin/sh pidfile=`grep "^pidfile=" /etc/webmin/miniserv.conf | sed -e 's/pidfile=//g'` @@ -282,7 +283,7 @@ fi inetd=`grep "^inetd=" /etc/$baseproduct/miniserv.conf 2>/dev/null | sed -e 's/inetd=//g'` if [ "\$1" = "upgrade" -a "\$1" != "abort-upgrade" ]; then - # Upgrading the package, so stop the old webmin properly + # Upgrading the package, so stop the old Webmin properly if [ "\$inetd" != "1" ]; then /etc/$baseproduct/stop >/dev/null 2>&1 /dev/null 2>&1 ] && [ -d "/etc/systemd" ]; then systemctl daemon-reload >/dev/null 2>&1 - + fi if [ "$inetd" != "1" ]; then if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then diff --git a/makerpm.pl b/makerpm.pl index bad0b2395..2a60b7d23 100755 --- a/makerpm.pl +++ b/makerpm.pl @@ -172,8 +172,9 @@ fi inetd=`grep "^inetd=" /etc/webmin/miniserv.conf 2>/dev/null | sed -e 's/inetd=//g'` startafter=0 -# Fix old versions of Webmin that might kill the UI process on upgrade -if [ -d /etc/webmin ]; then +# Fix old versions of Webmin that might kill the UI +# process on upgrade, unless it's already fixed version +if [ -d /etc/webmin ] && [ ! -f "/etc/webmin/stop-init" ]; then cat >/etc/webmin/stop 2>/dev/null <<'EOD' #!/bin/sh pidfile=`grep "^pidfile=" /etc/webmin/miniserv.conf | sed -e 's/pidfile=//g'` @@ -188,7 +189,7 @@ EOD fi if [ "\$1" != 1 ]; then - # Upgrading the RPM, so stop the old webmin properly + # Upgrading the RPM, so stop the old Webmin properly if [ "\$inetd" != "1" ]; then kill -0 `cat /var/webmin/miniserv.pid 2>/dev/null` 2>/dev/null if [ "\$?" = 0 ]; then