diff --git a/actions/upgrades b/actions/upgrades index 21ae813b9..1ac39fe8b 100755 --- a/actions/upgrades +++ b/actions/upgrades @@ -12,8 +12,7 @@ import subprocess import sys from plinth.action_utils import (apt_hold, debconf_set_selections, - run_apt_command, service_is_running, - service_restart) + run_apt_command) from plinth.modules.apache.components import check_url from plinth.modules.upgrades import (BACKPORTS_SOURCES_LIST, SOURCES_LIST, get_current_release, is_backports_current) @@ -455,11 +454,10 @@ def subcommand_activate_backports(arguments): def subcommand_start_dist_upgrade(_): """Start dist upgrade process.""" - if not service_is_running('freedombox-dist-upgrade'): - subprocess.Popen(['systemctl', 'start', 'freedombox-dist-upgrade'], - stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, close_fds=True, - start_new_session=True) + subprocess.Popen(['systemctl', 'start', 'freedombox-dist-upgrade'], + stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, close_fds=True, + start_new_session=True) def subcommand_dist_upgrade(arguments): diff --git a/plinth/modules/upgrades/data/etc/needrestart/conf.d/freedombox.conf b/plinth/modules/upgrades/data/etc/needrestart/conf.d/freedombox.conf index 34a811b7c..c01edd9d2 100644 --- a/plinth/modules/upgrades/data/etc/needrestart/conf.d/freedombox.conf +++ b/plinth/modules/upgrades/data/etc/needrestart/conf.d/freedombox.conf @@ -1,5 +1,6 @@ # Automatically restart services when needed. $nrconf{restart} = 'a'; -# Don't restart freedombox-manual-upgrade.service. +# Don't restart freedombox upgrade services. $nrconf{override_rc}->{qr(^freedombox-manual-upgrade\.service$)} = 0; +$nrconf{override_rc}->{qr(^freedombox-dist-upgrade\.service$)} = 0; diff --git a/plinth/modules/upgrades/data/lib/systemd/system/freedombox-dist-upgrade.service b/plinth/modules/upgrades/data/lib/systemd/system/freedombox-dist-upgrade.service index 679904f3a..a7362c874 100644 --- a/plinth/modules/upgrades/data/lib/systemd/system/freedombox-dist-upgrade.service +++ b/plinth/modules/upgrades/data/lib/systemd/system/freedombox-dist-upgrade.service @@ -2,8 +2,7 @@ Description=Upgrade to new stable Debian release [Service] -Type=simple +Type=oneshot ExecStart=/usr/share/plinth/actions/upgrades dist-upgrade -KillMode=none -TimeoutStopSec=3600 -Restart=no +KillMode=process +TimeoutStopSec=900