mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
migrate_to_bullseye: Try to tell the system to not yolorestart nginx in the middle of the big upgrade because of nginx-common...
This commit is contained in:
parent
71f456286a
commit
938d08134e
1 changed files with 11 additions and 1 deletions
|
@ -5,7 +5,7 @@ from moulinette import m18n
|
|||
from yunohost.utils.error import YunohostError
|
||||
from moulinette.utils.log import getActionLogger
|
||||
from moulinette.utils.process import check_output, call_async_output
|
||||
from moulinette.utils.filesystem import read_file, rm
|
||||
from moulinette.utils.filesystem import read_file, rm, write_to_file
|
||||
|
||||
from yunohost.tools import (
|
||||
Migration,
|
||||
|
@ -81,6 +81,16 @@ class MyMigration(Migration):
|
|||
"echo 'libc6 libraries/restart-without-asking boolean true' | debconf-set-selections"
|
||||
)
|
||||
|
||||
# Do not restart nginx during the upgrade of nginx-common ...
|
||||
# c.f. https://manpages.debian.org/bullseye/init-system-helpers/deb-systemd-invoke.1p.en.html
|
||||
# and the code inside /usr/bin/deb-systemd-invoke to see how it calls /usr/sbin/policy-rc.d ...
|
||||
write_to_file(
|
||||
'/usr/sbin/policy-rc.d',
|
||||
'#!/bin/bash\n[[ "$1" == "nginx" ]] && return 101 || return 0'
|
||||
)
|
||||
os.system("chmod +x /usr/sbin/policy-rc.d")
|
||||
# FIXME: we still need to explicitly restart nginx somewhere ...
|
||||
|
||||
# Don't send an email to root about the postgresql migration. It should be handled automatically after.
|
||||
os.system(
|
||||
"echo 'postgresql-common postgresql-common/obsolete-major seen true' | debconf-set-selections"
|
||||
|
|
Loading…
Add table
Reference in a new issue