From 2886e367b328d58868e6ac38af4daa40afdbf1c6 Mon Sep 17 00:00:00 2001 From: Fredrik Eriksson Date: Thu, 25 Jul 2024 19:25:12 +0200 Subject: [PATCH] add live_system config option This is to be used in environments where reboot is strictly unneeded; such as when building packages in a chroot --- bin/sau | 3 +++ config.cfg | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/bin/sau b/bin/sau index 06d9928..bd3478d 100755 --- a/bin/sau +++ b/bin/sau @@ -115,6 +115,9 @@ def main(): log.error(f'Upgrade failed: {e}') return 1 + if not conf.getboolean('default', 'live_system', True): + return 0 + if conf.getboolean('default', 'do_service_restart', fallback=True): reboot_recommended = sau.services.restart_services() diff --git a/config.cfg b/config.cfg index 8f34027..1fccad0 100644 --- a/config.cfg +++ b/config.cfg @@ -12,6 +12,10 @@ # 1.0.1 -> 1.0.1.1 (3) version_sensitivity=1 +# Set to no if you're using sau in an environment where running processes +# shouldn't be touched and reboots shouldn't be done, for example in chroots +live_system=yes + # sau can reboot on system upgrades (FreeBSD) or if the service restarts does # not close all deleted files (any platform) do_reboot=no