I found this page https://akmatori.com/blog/understanding ... ile-ubuntu. Apparently it is a postinst script's responsibility to create an empty /run/reboot-required file if during a package installation it wants the system to reboot for the package to take effect. It is any notification tool's responsibility to monitor this and make the appropriate notification.
I am only concerned about the postinst script right now so I added the following, and cleaned up some obvious mistakes in the script, and the first couple of setups seem to do the right thing:
I wasn't previously aware of the role of /run/reboot-request. It is good to know.
Thanks
Chris
I am only concerned about the postinst script right now so I added the following, and cleaned up some obvious mistakes in the script, and the first couple of setups seem to do the right thing:
Code:
## If we don't need to reboot to get the I2C bus device go# ahead and restart the service.#if [ $need_reboot = "false" ]; then # # If it is currently running pick up the new version # restart will stop and start a new one if one is running or # start a new one if not # systemctl -q restart $qw_serviceelse # # We need to indicate that a reboot is needed # touch /run/reboot-required # If the package isn't already in the reboot-required.pkgs file then add it if [ ! -f /run/reboot-required.pkgs ] || ! grep -q "qw-weatherstation" /run/reboot-required.pkgs; then echo "qw-weatherstation" >> /run/reboot-required.pkgs fifiThanks
Chris
Statistics: Posted by chriskot870 — Sat Jun 14, 2025 6:31 am