mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
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:
parent
0241b82479
commit
a66520f3ff
@ -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):
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user