mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
upgrades: Use a custom service for manual update
- Do not enable/start service during package install/upgrade - Configure needrestart to skip restarting service Closes: #1638. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> [sunil: Provide proper regex string in needrestart configuration with qr()] Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
1 parent
10617b900e
commit
2d1ced84cd
4 files changed
+17
-2
No files matched your search
+2
-2
@@ -83,12 +83,12 @@ def parse_arguments():
|
||||
def subcommand_run(_):
|
||||
"""Run unattended-upgrades"""
|
||||
try:
|
||||
subprocess.Popen(['unattended-upgrades', '-v'],
|
||||
subprocess.Popen(['systemctl', 'start', 'freedombox-manual-upgrade'],
|
||||
stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL, close_fds=True,
|
||||
start_new_session=True)
|
||||
except FileNotFoundError:
|
||||
print('Error: unattended-upgrades is not available.', file=sys.stderr)
|
||||
print('Error: systemctl is not available.', file=sys.stderr)
|
||||
sys.exit(2)
|
||||
except Exception as error:
|
||||
print('Error: {0}'.format(error), file=sys.stderr)
|
||||
|
||||
Reference in new issue
Block a user