configure needrestart

This commit is contained in:
Matthew Saunders Brown 2022-10-18 16:28:39 -07:00
parent b440ac403e
commit 059927c38c

View File

@ -32,8 +32,13 @@ fi
apt-get update
# modify policy-rc.d so that packages automatically start/restart/stop after install/upgrade/uninstall
sed -i "s|exit 101|exit 0|g" /usr/sbin/policy-rc.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
if [[ -f /etc/needrestart/needrestart.conf ]]; then
sed -i "s|^#\$nrconf{restart} = 'i';|\$nrconf{restart} = 'a';|g" /etc/needrestart/needrestart.conf
fi
# install pwgen, used to create random passwords
DEBIAN_FRONTEND=noninteractive apt-get -y install pwgen