Startup scripts get run when guest packages are updated
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gce-compute-image-packages (Ubuntu) |
Fix Released
|
Medium
|
Philip Roche | ||
Trusty |
Fix Released
|
Medium
|
Philip Roche | ||
Xenial |
Fix Released
|
Medium
|
Philip Roche | ||
Yakkety |
Fix Released
|
Medium
|
Philip Roche | ||
Zesty |
Fix Released
|
Medium
|
Philip Roche |
Bug Description
[Impact]
* This bug affects: Zesty, Yakkety, Xenial and Trusty
* When a user upgrades to a newer version of gce-cimpute-
then the google-
startup scripts to be executed.
* Running these scripts more than once on a running instance is not exptected
behaviour and depending on the contents of the user's scripts could have
disastrous consequences.
* The fix tis to use override_
generated postinst, prerm and postrm files to not restart the startup or
shutdown scripts on upgrade or install.
[Test Case]
* Start instance with shutdown script and startup script
gcloud compute instances create ubuntu-
--image "ubuntu-
touch /home/ubuntu/
touch /home/ubuntu/
# Run the following on the running instance
# clean up instance ready for testing
rm -f ~/startup.txt
# Add new PPA with fixed package
sudo add-apt-repository -y ppa:philroche/
sudo apt-get update
sudo apt-get install --only-upgrade gce-compute-
# Note that the first upgrade will always result in shutdown
# scripts being run as the initial gce-compute-
# verify that the bug still exists
if [ -f ~/shutdown.txt ]; then
echo "Shutdown File found! Bug still present"
rm -f ~/shutdown.txt
fi
[Regression Potential]
* Possible regressions are that the startup and shutdown script services never start and user's scripts to not get
executed. This has been tested and is not the case.
[Original bug description]
A user reported (https:/
I did some digging and found that the postinst you are using is not the same as ours and appears to start all the systemd services including startup and shutdown scripts when it runs.
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
We have a postinst that works on other systemd platforms which you are welcome to use or mimic here: https:/
Related branches
- Ubuntu Development Team: Pending requested
-
Diff: 100 lines (+62/-0) (has conflicts)4 files modifieddebian/99-gce.rules (+2/-0)
debian/changelog (+44/-0)
debian/gce-compute-image-packages.install (+8/-0)
debian/rules (+8/-0)
description: | updated |
tags: | added: patch trusty xenial yakkety zesty |
Changed in gce-compute-image-packages (Ubuntu): | |
importance: | Undecided → Medium |
Changed in gce-compute-image-packages (Ubuntu Yakkety): | |
status: | New → Fix Committed |
Changed in gce-compute-image-packages (Ubuntu Zesty): | |
status: | Confirmed → Fix Committed |
Changed in gce-compute-image-packages (Ubuntu Xenial): | |
status: | New → Fix Committed |
Changed in gce-compute-image-packages (Ubuntu Trusty): | |
status: | New → Fix Committed |
assignee: | nobody → Philip Roche (philroche) |
Changed in gce-compute-image-packages (Ubuntu Xenial): | |
assignee: | nobody → Philip Roche (philroche) |
Changed in gce-compute-image-packages (Ubuntu Yakkety): | |
assignee: | nobody → Philip Roche (philroche) |
Changed in gce-compute-image-packages (Ubuntu Zesty): | |
status: | Fix Committed → In Progress |
Changed in gce-compute-image-packages (Ubuntu Yakkety): | |
status: | Fix Committed → In Progress |
Changed in gce-compute-image-packages (Ubuntu Xenial): | |
status: | Fix Committed → In Progress |
Changed in gce-compute-image-packages (Ubuntu Trusty): | |
status: | Fix Committed → In Progress |
tags: | added: verification-done-trusty verification-done-xenial verification-done-yakkety |
Changed in gce-compute-image-packages (Ubuntu Trusty): | |
importance: | Undecided → Medium |
Changed in gce-compute-image-packages (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in gce-compute-image-packages (Ubuntu Yakkety): | |
importance: | Undecided → Medium |
The postinst file used in the ubuntu package was auto-generated by debhelper command sequencer [1]. I will start the process of including your postinst and prerm scripts instead of relying on debhelper command sequencer auto generated ones.
[1] http:// manpages. ubuntu. com/manpages/ zesty/man1/ dh.1.html