From bc72c58c117b5274c7839bb62d4a4ae9d5a90c51 Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Mon, 9 Oct 2023 15:11:33 -0700 Subject: [PATCH] configure policy-rc.d and needrestart to automatically start/restart/stop after install/upgrade/uninstall --- install.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install.sh b/install.sh index 6d54d10..08e5241 100644 --- a/install.sh +++ b/install.sh @@ -24,7 +24,12 @@ 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 if [[ -f /etc/needrestart/needrestart.conf ]]; then + sed -i "s|^#\$nrconf{restart} = 'i';|\$nrconf{restart} = 'a';|g" /etc/needrestart/needrestart.conf # disable kernelhints (no warnings about currently running kernel version) echo '$nrconf{kernelhints} = 0;' > /etc/needrestart/conf.d/kernelhints.conf fi