From 7a83540130deb0884ecb94c90d7b82de8fae78fe Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Wed, 21 Feb 2024 14:41:04 -0800 Subject: [PATCH] change needrestart from automatic to list only --- install.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 08e5241..091e0bb 100644 --- a/install.sh +++ b/install.sh @@ -24,12 +24,10 @@ fi # set webmaster email address, used below WEBMASTER=webmaster@`hostname -d` -# have packages automatically start/restart/stop after install/upgrade/uninstall -if [[ -f /usr/sbin/policy-rc.d ]]; then - sed -i "s|exit 101|exit 0|g" /usr/sbin/policy-rc.d -fi +# set needrestart to list only, which is also default for unattended upgrades if [[ -f /etc/needrestart/needrestart.conf ]]; then - sed -i "s|^#\$nrconf{restart} = 'i';|\$nrconf{restart} = 'a';|g" /etc/needrestart/needrestart.conf + sed -i "s|^#\$nrconf{restart} = 'i';|\$nrconf{restart} = 'l';|g" /etc/needrestart/needrestart.conf + # 'l' = list only, change to 'a' for automatic restart or 'i' for interactive # disable kernelhints (no warnings about currently running kernel version) echo '$nrconf{kernelhints} = 0;' > /etc/needrestart/conf.d/kernelhints.conf fi