Comment 7 for bug 1999159

Revision history for this message
Chad Smith (chad.smith) wrote :

SRU verification results pointing to no try-restart in cloud-init.postinst, and confirmed no service restarts across upgrade path. Any service restart would trigger new logs in either cloud-init analyze show or cloud-init-output.log.

+ echo ==== Focal Verification of https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1999159 ====
==== Focal Verification of https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1999159 ====
+ cat
+ lxc launch ubuntu-daily:focal sru-f
Creating sru-f
Starting sru-f
+ lxc exec sru-f -- cloud-init status --wait --long
.........................................................
status: done
time: Fri, 09 Dec 2022 00:01:17 +0000
detail:
DataSourceNoCloud [seed=/var/lib/cloud/seed/nocloud-net][dsmode=net]
+ echo '=== OLD version Before cloud-init upgrade'
=== OLD version Before cloud-init upgrade
+ lxc exec sru-f -- cloud-init -v
/usr/bin/cloud-init 22.3.4-0ubuntu1~20.04.1
+ echo '=== Track number of boot events cloud-init saw before upgrade from 22.4.2'
=== Track number of boot events cloud-init saw before upgrade from 22.4.2
++ lxc exec sru-f -- cloud-init analyze show
++ grep 'boot record'
+ BOOT_RECORDS='1 boot records analyzed'
+ echo '=== OLD version postinst contains try-restart logic to restart cloud-init services'
=== OLD version postinst contains try-restart logic to restart cloud-init services
+ lxc exec sru-f grep try-restart /var/lib/dpkg/info/cloud-init.postinst
   deb-systemd-invoke try-restart 'cloud-config.service' 'cloud-config.target' 'cloud-final.service' 'cloud-init-hotplugd.service' 'cloud-init-hotplugd.socket' 'cloud-init-local.service' 'cloud-init.service' 'cloud-init.target' >/dev/null || true
+ echo SUCCESS: OLD version still restarts services
SUCCESS: OLD version still restarts services
+ echo '=== Upgrade to -proposed version of cloud-init: ....20.04.2'
=== Upgrade to -proposed version of cloud-init: ....20.04.2
+ lxc file push setup_proposed.sh sru-f/
+ lxc exec sru-f -- bash /setup_proposed.sh
deb http://archive.ubuntu.com/ubuntu focal-proposed main
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-proposed InRelease [267 kB]
Get:6 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [1892 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [8628 kB]
Get:8 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [310 kB]
Get:9 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [11.5 kB]
Get:10 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [1383 kB]
Get:11 http://security.ubuntu.com/ubuntu focal-security/restricted Translation-en [195 kB]
Get:12 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 c-n-f Metadata [596 B]
Get:13 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [777 kB]
Get:14 http://security.ubuntu.com/ubuntu focal-security/universe Translation-en [150 kB]
Get:15 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [16.9 kB]
Get:16 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [22.2 kB]
Get:17 http://security.ubuntu.com/ubuntu focal-security/multiverse Translation-en [5464 B]
Get:18 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 c-n-f Metadata [516 B]
Get:19 http://archive.ubuntu.com/ubuntu focal/universe Translation-en [5124 kB]
Get:20 http://archive.ubuntu.com/ubuntu focal/universe amd64 c-n-f Metadata [265 kB]
Get:21 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [144 kB]
Get:22 http://archive.ubuntu.com/ubuntu focal/multiverse Translation-en [104 kB]
Get:23 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 c-n-f Metadata [9136 B]
Get:24 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2267 kB]
Get:25 http://archive.ubuntu.com/ubuntu focal-updates/main Translation-en [395 kB]
Get:26 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [16.1 kB]
Get:27 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [1473 kB]
Get:28 http://archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [208 kB]
Get:29 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 c-n-f Metadata [592 B]
Get:30 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1008 kB]
Get:31 http://archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [234 kB]
Get:32 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [23.2 kB]
Get:33 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [24.5 kB]
Get:34 http://archive.ubuntu.com/ubuntu focal-updates/multiverse Translation-en [7380 B]
Get:35 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [592 B]
Get:36 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [45.7 kB]
Get:37 http://archive.ubuntu.com/ubuntu focal-backports/main Translation-en [16.3 kB]
Get:38 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 c-n-f Metadata [1420 B]
Get:39 http://archive.ubuntu.com/ubuntu focal-backports/restricted amd64 c-n-f Metadata [116 B]
Get:40 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [24.9 kB]
Get:41 http://archive.ubuntu.com/ubuntu focal-backports/universe Translation-en [16.3 kB]
Get:42 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [880 B]
Get:43 http://archive.ubuntu.com/ubuntu focal-backports/multiverse amd64 c-n-f Metadata [116 B]
Get:44 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 Packages [227 kB]
Get:45 http://archive.ubuntu.com/ubuntu focal-proposed/main Translation-en [52.4 kB]
Get:46 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 c-n-f Metadata [2136 B]
Fetched 25.7 MB in 5s (5182 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following package was automatically installed and is no longer required:
  libfreetype6
Use 'apt autoremove' to remove it.
The following packages will be upgraded:
  cloud-init
1 upgraded, 0 newly installed, 0 to remove and 48 not upgraded.
Need to get 530 kB of archives.
After this operation, 120 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 cloud-init all 22.4.2-0ubuntu0~20.04.2 [530 kB]
Fetched 530 kB in 0s (1431 kB/s)
Preconfiguring packages ...
(Reading database ... 32018 files and directories currently installed.)
Preparing to unpack .../cloud-init_22.4.2-0ubuntu0~20.04.2_all.deb ...
Unpacking cloud-init (22.4.2-0ubuntu0~20.04.2) over (22.3.4-0ubuntu1~20.04.1) ...
Setting up cloud-init (22.4.2-0ubuntu0~20.04.2) ...
Installing new version of config file /etc/cloud/cloud.cfg ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for rsyslog (8.2001.0-1ubuntu1.3) ...
+ lxc exec sru-f -- cloud-init -v
/usr/bin/cloud-init 22.4.2-0ubuntu0~20.04.2
+ echo '=== Number of boot events from cloud-init service restart should not have changed'
=== Number of boot events from cloud-init service restart should not have changed
++ lxc exec sru-f -- cloud-init analyze show
++ grep 'boot record'
+ NEW_BOOT_RECORDS='1 boot records analyzed'
+ '[' '1 boot records analyzed' == '1 boot records analyzed' ']'
+ echo SUCCESS same number of boot records across upgrade
SUCCESS same number of boot records across upgrade
+ echo '=== NEW version postinst does NOT contain try-restart logic for cloud-init services'
=== NEW version postinst does NOT contain try-restart logic for cloud-init services
+ lxc exec sru-f grep try-restart /var/lib/dpkg/info/cloud-init.postinst
+ echo SUCCESS: NEW version does not try-restart cloud-init services
SUCCESS: NEW version does not try-restart cloud-init services
+ echo === No new log messages indicating NEW version of cloud-init was restarted
=== No new log messages indicating NEW version of cloud-init was restarted
+ lxc exec sru-f grep 22.4.2-0ubuntu0~20.04.2 /var/log/cloud-init-output.log
+ echo SUCCESS: not service restarts across upgrade
SUCCESS: not service restarts across upgrade

After this test was complete a manual trigger or service restarts shows boot records incremented in cloud-init logs.
csmith@uptown:~$ lxc exec sru-f bash
root@sru-f:~# systemctl restart cloud-init-local.service
root@sru-f:~# systemctl restart cloud-init.service
root@sru-f:~# systemctl restart cloud-config.service
root@sru-f:~# systemctl restart cloud-final.service
(failed reverse-i-search)`show': systemctl restart cloud-final.^Crvice
root@sru-f:~# cloud-init analyze show | grep 'boot record'
2 boot records analyzed # instead of previous 1 boot record