apt dist-upgrade does not restart package qemu-guest-agent
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
qemu (Ubuntu) |
Fix Released
|
Undecided
|
Sergio Durigan Junior | ||
Jammy |
Fix Released
|
Undecided
|
Mitchell Dzurick | ||
Lunar |
Fix Released
|
Undecided
|
Mitchell Dzurick |
Bug Description
[Impact]
When upgrading qemu-guest-agent, the service is not restarted. This can cause an issue in certain scenarios such as using Terraform where the servers get automatically updated, and then get lost due to qemu-guest-agent not restarting.
[Fix]
The fix is to remove --no-start from dh_installsystemd
This is a backport from the following debian commit - https:/
[Test Case]
set of steps to reproduce the issue. With the fix, qemu-guest-agent should be active after reinstalling.
$ lxc launch ubuntu:jammy j --vm -c limits.memory=8GB
$ lxc shell j
# apt update && apt install -y uvtool uvtool-libvirt
# su - ubuntu
$ ssh-keygen
$ uvt-simplestrea
$ uvt-kvm create test release=jammy --memory 2024
$ uvt-kvm wait test
$ uvt-kvm ssh test
# apt install qemu-guest-agent
# systemctl start qemu-guest-agent
# apt install --reinstall qemu-guest-agent
# systemctl status qemu-guest-agent
[Things that can go wrong]
- Security considerations of automatically starting qemu-guest-agent. It should be presumed that users understand the package they are installing.
- If the hypervisor can change settings to no longer support qemu-guest-agent service, then attempting to start the service will fail. I'm not sure if this scenario is possible.
Related branches
- Bryce Harrington (community): Approve
- Canonical Server Reporter: Pending requested
- git-ubuntu import: Pending requested
-
Diff: 27 lines (+7/-1)2 files modifieddebian/changelog (+6/-0)
debian/rules (+1/-1)
- Paride Legovini (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 27 lines (+7/-1)2 files modifieddebian/changelog (+6/-0)
debian/rules (+1/-1)
- Paride Legovini (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 27 lines (+7/-1)2 files modifieddebian/changelog (+6/-0)
debian/rules (+1/-1)
Changed in qemu (Ubuntu): | |
assignee: | nobody → Sergio Durigan Junior (sergiodj) |
Changed in qemu (Ubuntu Lunar): | |
assignee: | nobody → Sergio Durigan Junior (sergiodj) |
Changed in qemu (Ubuntu Jammy): | |
assignee: | nobody → Sergio Durigan Junior (sergiodj) |
tags: |
added: server-todo removed: server-triage-discuss |
Changed in qemu (Ubuntu Jammy): | |
assignee: | Sergio Durigan Junior (sergiodj) → Mitchell Dzurick (mitchdz) |
Changed in qemu (Ubuntu Lunar): | |
assignee: | Sergio Durigan Junior (sergiodj) → Mitchell Dzurick (mitchdz) |
description: | updated |
description: | updated |
Changed in qemu (Ubuntu Jammy): | |
status: | Triaged → In Progress |
Changed in qemu (Ubuntu Lunar): | |
status: | Triaged → In Progress |
tags: |
added: verification-done-lunar removed: verification-needed-lunar |
tags: |
added: verification-done removed: verification-needed |
Hi,
I can confirm the issue. We have several virtual machines with 22.04 (upgraded from 18.04) with the same issue on each qemu-guest-agent upgrade. In the follow example the service is stopped with he upgrade of the package at '2023-07-17 13:21:02'
root@vm1:~# grep -i qemu /var/log/dpkg.log agent:amd64 1:4.2-3ubuntu6.27 1:6.2+dfsg- 2ubuntu6. 11 agent:amd64 1:4.2-3ubuntu6.27 agent:amd64 1:4.2-3ubuntu6.27 agent:amd64 1:4.2-3ubuntu6.27 agent:amd64 1:6.2+dfsg- 2ubuntu6. 11 agent:amd64 1:6.2+dfsg- 2ubuntu6. 11 <none> agent:amd64 1:6.2+dfsg- 2ubuntu6. 11 agent:amd64 1:6.2+dfsg- 2ubuntu6. 11 agent:amd64 1:6.2+dfsg- 2ubuntu6. 11 agent:amd64 1:6.2+dfsg- 2ubuntu6. 11 1:6.2+dfsg- 2ubuntu6. 12 agent:amd64 1:6.2+dfsg- 2ubuntu6. 11 agent:amd64 1:6.2+dfsg- 2ubuntu6. 11 agent:amd64 1:6.2+dfsg- 2ubuntu6. 11 agent:amd64 1:6.2+dfsg- 2ubuntu6. 12 agent:amd64 1:6.2+dfsg- 2ubuntu6. 12 <none> agent:amd64 1:6.2+dfsg- 2ubuntu6. 12 agent:amd64 1:6.2+dfsg- 2ubuntu6. 12 agent:amd64 1:6.2+dfsg- 2ubuntu6. 12
2023-07-03 20:58:18 upgrade qemu-guest-
2023-07-03 20:58:18 status half-configured qemu-guest-
2023-07-03 20:58:18 status unpacked qemu-guest-
2023-07-03 20:58:18 status half-installed qemu-guest-
2023-07-03 20:59:18 status unpacked qemu-guest-
2023-07-03 21:00:06 configure qemu-guest-
2023-07-03 21:00:06 status unpacked qemu-guest-
2023-07-03 21:00:06 status half-configured qemu-guest-
2023-07-03 21:00:06 status installed qemu-guest-
2023-07-17 13:21:02 upgrade qemu-guest-
2023-07-17 13:21:02 status half-configured qemu-guest-
2023-07-17 13:21:02 status unpacked qemu-guest-
2023-07-17 13:21:02 status half-installed qemu-guest-
2023-07-17 13:21:02 status unpacked qemu-guest-
2023-07-17 13:21:05 configure qemu-guest-
2023-07-17 13:21:05 status unpacked qemu-guest-
2023-07-17 13:21:05 status half-configured qemu-guest-
2023-07-17 13:21:05 status installed qemu-guest-
root@vm1:~# systemctl status qemu-guest- agent.service agent.service - QEMU Guest Agent system/ qemu-guest- agent.service; static)
○ qemu-guest-
Loaded: loaded (/lib/systemd/
Active: inactive (dead) since Mon 2023-07-17 13:21:02 CEST; 2 days ago
Main PID: 763 (code=exited, status=0/SUCCESS)
CPU: 58ms
Jul 11 05:42:42 vm1 qemu-ga[763]: info: guest-fsfreeze called agent.service: Deactivated successfully.
Jul 12 05:44:36 vm1 qemu-ga[763]: info: guest-fsfreeze called
Jul 13 04:43:06 vm1 qemu-ga[763]: info: guest-fsfreeze called
Jul 14 05:57:13 vm1 qemu-ga[763]: info: guest-fsfreeze called
Jul 15 05:46:10 vm1 qemu-ga[763]: info: guest-fsfreeze called
Jul 16 06:22:59 vm1 qemu-ga[763]: info: guest-fsfreeze called
Jul 17 05:40:00 vm1 qemu-ga[763]: info: guest-fsfreeze called
Jul 17 13:21:02 vm1 systemd[1]: Stopping QEMU Guest Agent...
Jul 17 13:21:02 vm1 systemd[1]: qemu-guest-
Jul 17 13:21:02 vm1 systemd[1]: Stopped QEMU Guest Agent.
Kind regards,
Achim