-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: set /var/run/reboot-required by DPkg::Post-Invoke for deferred services #236
Comments
This seems to work OK. When unattended-upgrade runs and triggers package installs, the new post-invoke writes the reboot-required and then unattended-upgrade triggers the reboot. I named the file 99needrestart-reboot, as I don't think 100if-* will do what you want - they are executed in alphabetical order, so 100 comes before 11. |
This sounds like a valid approach. The script could even be shortened: #!/bin/sh
# if nagios check for needrestart is not OK and
# /var/run/reboot-required is not already set,
# create /var/run/reboot-required
if [ ! -f /var/run/reboot-required ]; then
needrestart -p 2>&1 || exec touch /var/run/reboot-required
fi |
Would this make a good built-in feature for needrestart? |
I've had it running for a few weeks now and don't see any problems. Thank you for pointing out the alphabetical sorting. I had not considered that. An inclusion in the normal version would be great, sure. Of course with a configurable toogle switch. |
Maybe. I wonder under which conditions (depending on the run mode, kernel and microcode status etc.) the |
I am using Ubuntu 20.04 with unattended-upgrade & needrestart on various (productive and semi-productive) hosts.
Especially these "semi-productive" servers or redundant systems can be restarted frequently. Therefore, these systems should update themselves as autonomously as possible (with appropriate monitoring, of course).
I know that various services/units cannot be restarted automatically by needrestart, but maybe there is a workaround? My idea was to invoke a simple shell-script in
/etc/apt/apt.conf.d/100if-deferred-set-reboot-required
:Is this a bad idea or not even possible?
Best
Helge
The text was updated successfully, but these errors were encountered: