mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +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
|
import sys
|
||||||
|
|
||||||
from plinth.action_utils import (apt_hold, debconf_set_selections,
|
from plinth.action_utils import (apt_hold, debconf_set_selections,
|
||||||
run_apt_command, service_is_running,
|
run_apt_command)
|
||||||
service_restart)
|
|
||||||
from plinth.modules.apache.components import check_url
|
from plinth.modules.apache.components import check_url
|
||||||
from plinth.modules.upgrades import (BACKPORTS_SOURCES_LIST, SOURCES_LIST,
|
from plinth.modules.upgrades import (BACKPORTS_SOURCES_LIST, SOURCES_LIST,
|
||||||
get_current_release, is_backports_current)
|
get_current_release, is_backports_current)
|
||||||
@ -455,11 +454,10 @@ def subcommand_activate_backports(arguments):
|
|||||||
|
|
||||||
def subcommand_start_dist_upgrade(_):
|
def subcommand_start_dist_upgrade(_):
|
||||||
"""Start dist upgrade process."""
|
"""Start dist upgrade process."""
|
||||||
if not service_is_running('freedombox-dist-upgrade'):
|
subprocess.Popen(['systemctl', 'start', 'freedombox-dist-upgrade'],
|
||||||
subprocess.Popen(['systemctl', 'start', 'freedombox-dist-upgrade'],
|
stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
|
||||||
stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
|
stderr=subprocess.DEVNULL, close_fds=True,
|
||||||
stderr=subprocess.DEVNULL, close_fds=True,
|
start_new_session=True)
|
||||||
start_new_session=True)
|
|
||||||
|
|
||||||
|
|
||||||
def subcommand_dist_upgrade(arguments):
|
def subcommand_dist_upgrade(arguments):
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
# Automatically restart services when needed.
|
# Automatically restart services when needed.
|
||||||
$nrconf{restart} = 'a';
|
$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-manual-upgrade\.service$)} = 0;
|
||||||
|
$nrconf{override_rc}->{qr(^freedombox-dist-upgrade\.service$)} = 0;
|
||||||
|
|||||||
@ -2,8 +2,7 @@
|
|||||||
Description=Upgrade to new stable Debian release
|
Description=Upgrade to new stable Debian release
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=oneshot
|
||||||
ExecStart=/usr/share/plinth/actions/upgrades dist-upgrade
|
ExecStart=/usr/share/plinth/actions/upgrades dist-upgrade
|
||||||
KillMode=none
|
KillMode=process
|
||||||
TimeoutStopSec=3600
|
TimeoutStopSec=900
|
||||||
Restart=no
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user