upgrades: Don't allow needrestart to restart freedombox-dist-upgrade

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2021-01-04 17:14:44 -05:00 committed by Sunil Mohan Adapa
parent 0241b82479
commit a66520f3ff
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
3 changed files with 10 additions and 12 deletions

View File

@ -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):

View File

@ -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;

View File

@ -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