automatically restart services (#2459)

Signed-off-by: Daniel Hansson <mailto@danielhansson.nu>
This commit is contained in:
Daniel Hansson 2023-03-24 11:38:21 +01:00 committed by GitHub
parent c6701426fc
commit 33ff2d6288
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,6 +32,16 @@ root_check
is_process_running apt
is_process_running dpkg
# Automatically restart services (Ubuntu 22.04)
if ! version 16.04.10 "$DISTRO" 20.04.10
then
if ! grep -r "{restart} = 'a'" /etc/needrestart/needrestart.conf
then
# Restart mode: (l)ist only, (i)nteractive or (a)utomatically.
sed -i "s|#\$nrconf{restart} = .*|\$nrconf{restart} = 'a';|g" /etc/needrestart/needrestart.conf
fi
fi
# Check for pending-snapshot
if does_snapshot_exist "NcVM-snapshot-pending"
then