[Bug 2019089] Re: shutdown-scripts service is restarted on package upgrade - causing any configured shutdown scripts to be run

Launchpad Bug Tracker 2019089 at bugs.launchpad.net
Thu May 18 06:49:33 UTC 2023


This bug was fixed in the package google-guest-agent -
20230426.00-0ubuntu2

---------------
google-guest-agent (20230426.00-0ubuntu2) mantic; urgency=medium

  * d/rules: Add --no-stop-on-upgrade for upgrade path
    to enforce no stop of the services on package upgrade.
    This has the desired side-effect of not stopping, starting or
    restarting the services as a part of the upgrade (LP: #2019089)
  * d/{rules,install}: ship gce-workload-cert-refresh.timer.

 -- Utkarsh Gupta <utkarsh at ubuntu.com>  Tue, 16 May 2023 11:11:11 +0530

** Changed in: google-guest-agent (Ubuntu Mantic)
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to google-guest-agent in Ubuntu.
https://bugs.launchpad.net/bugs/2019089

Title:
  shutdown-scripts service is restarted on package upgrade - causing any
  configured shutdown scripts to be run

Status in google-guest-agent package in Ubuntu:
  Fix Released
Status in google-guest-agent source package in Jammy:
  New
Status in google-guest-agent source package in Kinetic:
  New
Status in google-guest-agent source package in Lunar:
  New
Status in google-guest-agent source package in Mantic:
  Fix Released

Bug description:
  Initially reported @ https://github.com/GoogleCloudPlatform/guest-
  agent/issues/119

  It is only relevant for Ubuntu 22.04 and later.

  The previous logic https://git.launchpad.net/ubuntu/+source/google-
  guest-agent/tree/debian/rules#n20 in the package works fine in 20.04
  and 18.04 but not in 22.04+.

  Basically anytime the google-guest-agent package is updated, these
  services are restarted which means the customer scripts are run at a
  time they are not supposed to be. This caused an outage for one
  customer who had some logic in their shutdown script that basically
  turned off their services.

  The issue is most certainly in the autogenerated preinst script which
  should not be there. Stopping the shutdown service will invoke the
  shutdown script. This wasn't there in previous Ubuntu versions.

  
  Ubuntu 22.04 preinst script
  ```
  #!/bin/sh
  set -e
  # 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
  ```

  Ubuntu 20.04 preinst script

  ```
  root at ubu2004:/tmp/DEBIAN# cat preinst
  #!/bin/sh
  set -e
  # Automatically added by dh_installdeb/12.10ubuntu1
  dpkg-maintscript-helper rm_conffile /etc/defaults/instance_configs.cfg 20200617.00-0ubuntu2\~ -- "$@"
  # End automatically added section
  ```

  One reason this issue was of concern as the latest google-guest-agent
  update was a rebuild promoted by golang-1.18 being updated to address
  CVEs prompting a rebuild of all packages dependant on golang-1.18 and
  publication of those rebuilds to the -security pocket. unattended-
  upgrades then upgraded google-guest-agent in the background which
  restarted the shutdown-scripts.

  We do want the services to be enabled on initial installation and to
  be started on instance start but they should not be restarted/stopped
  during the lifetime of the instance.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/google-guest-agent/+bug/2019089/+subscriptions




More information about the foundations-bugs mailing list