Noble verification update: after posting the above I went back and tried to replicate the bug using the test plan for my peace of mind and was not able to. After some tweaking and input for others, I was able to reproduce the bug (and verify the -proposed package) using custom images:
Reproducer: # create instance based on custom image without fix $ gcloud compute instances create lp2063442 --image-project ubuntu-catred --image testing-ubuntu-2404-noble-amd64-v20240712 --metadata=startup-script='#! /bin/bash date | cat >> /tmp/lp2063442 sudo apt reinstall google-guest-agent -y date | cat >> /tmp/lp2063442 ' # not proposed version of needrestart catred@lp2063442:~$ sudo apt-cache policy needrestart needrestart: Installed: 3.6-7ubuntu4 Candidate: 3.6-7ubuntu4 Version table: *** 3.6-7ubuntu4 500 500 http://us-central1.gce.archive.ubuntu.com/ubuntu noble/main amd64 Packages 100 /var/lib/dpkg/status # startup scripts restarted catred@lp2063442:~$ cat /tmp/lp2063442 Mon Jul 15 16:09:41 UTC 2024 Mon Jul 15 16:09:53 UTC 2024 Mon Jul 15 16:11:53 UTC 2024 Mon Jul 15 16:11:53 UTC 2024 Verification of proposed packages: # create instance based on custom image without fix and with needrestart from -proposed catred@canonical:~/code/cpc_packaging.extra/noble$ gcloud compute instances create lp2063442-verify --image-project ubuntu-catred --image testing-ubuntu-2404-noble-amd64-v20240715 --metadata=startup-script='#! /bin/bash date | cat >> /tmp/lp2063442 sudo apt reinstall google-guest-agent -y date | cat >> /tmp/lp2063442 ' # verify needrestart is in proposed catred@lp2063442-verify:~$ sudo apt-cache policy needrestart needrestart: Installed: 3.6-7ubuntu4.1 Candidate: 3.6-7ubuntu4.1 Version table: *** 3.6-7ubuntu4.1 100 100 /var/lib/dpkg/status 3.6-7ubuntu4 500 500 http://us-central1.gce.archive.ubuntu.com/ubuntu noble/main amd64 Packages # verify startupscripts did not restart catred@lp2063442-verify:~$ cat /tmp/lp2063442 Mon Jul 15 16:20:57 UTC 2024 Mon Jul 15 16:21:07 UTC 2024 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2063442 Title: needrestart on Ubuntu 24.04 is restarting google-guest-agent startup and shutdown scrips on reinstall but they should not be restarted To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/needrestart/+bug/2063442/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs