I have a patched google-guest-agent for Ubuntu 22.04 in PPA https://launchpad.net/~philroche/+archive/ubuntu/google-guest-agent/
And reproducer script and logs @ https://people.canonical.com/~philroche/20230508-google-guest-agent-regression/
The reproducer confirms that the shutdown script is no longer run on upgrade.
The patch was as follows:
``` --- control/preinst +++ control/preinst @@ -3,8 +3,3 @@ # Automatically added by dh_installdeb/13.6ubuntu1 dpkg-maintscript-helper rm_conffile /etc/defaults/instance_configs.cfg 20200617.00-0ubuntu2\~ -- "$@" # End automatically added section -# Automatically added by dh_installsystemd/13.6ubuntu1 -if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = upgrade ] && [ -d /run/systemd/system ] ; then - deb-systemd-invoke stop 'google-shutdown-scripts.service' 'google-startup-scripts.service' >/dev/null || true -fi -# End automatically added section ```
This was achieved by updating the `debian/rules` files
``` --- debian/rules +++ debian/rules @@ -17,7 +17,7 @@
override_dh_installsystemd: dh_installsystemd google-guest-agent.service - dh_installsystemd --no-start --no-restart-after-upgrade google-startup-scripts.service google-shutdown-scripts.service + dh_installsystemd --no-start --no-restart-after-upgrade --no-restart-on-upgrade google-startup-scripts.service google-shutdown-scripts.service
override_dh_clean: dh_clean vendor/
```
I have a patched google-guest-agent for Ubuntu 22.04 in PPA https:/ /launchpad. net/~philroche/ +archive/ ubuntu/ google- guest-agent/
And reproducer script and logs @ https:/ /people. canonical. com/~philroche/ 20230508- google- guest-agent- regression/
The reproducer confirms that the shutdown script is no longer run on upgrade.
The patch was as follows:
``` 13.6ubuntu1 t-helper rm_conffile /etc/defaults/ instance_ configs. cfg 20200617. 00-0ubuntu2\ ~ -- "$@" md/13.6ubuntu1 shutdown- scripts. service' 'google- startup- scripts. service' >/dev/null || true
--- control/preinst
+++ control/preinst
@@ -3,8 +3,3 @@
# Automatically added by dh_installdeb/
dpkg-maintscrip
# End automatically added section
-# Automatically added by dh_installsyste
-if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = upgrade ] && [ -d /run/systemd/system ] ; then
- deb-systemd-invoke stop 'google-
-fi
-# End automatically added section
```
This was achieved by updating the `debian/rules` files
```
--- debian/rules
+++ debian/rules
@@ -17,7 +17,7 @@
override_ dh_installsyste md: guest-agent. service after-upgrade google- startup- scripts. service google- shutdown- scripts. service after-upgrade --no-restart- on-upgrade google- startup- scripts. service google- shutdown- scripts. service
dh_installsystemd google-
- dh_installsystemd --no-start --no-restart-
+ dh_installsystemd --no-start --no-restart-
override_dh_clean:
dh_clean vendor/
```