Comment 2 for bug 2019089

Revision history for this message
Philip Roche (philroche) wrote (last edit ):

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/

```