Comment 17 for bug 2028124

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

> - Security considerations of automatically starting qemu-guest-agent. It should be presumed that users
> understand the package they are installing.

What's interesting with this change:

- dh_installsystemd -pqemu-guest-agent --no-start --no-enable
+ dh_installsystemd -pqemu-guest-agent --no-enable

Is that qemu-guest-agent is still not started upon fresh install.

Checking what is called during first install:

17:22:46 3.244 deb-systemd-inv 7897 7833 0 /usr/bin/deb-systemd-invoke start qemu-guest-agent.service
17:22:46 3.252 sh 7898 7897 0 /bin/sh -c systemctl --system is-enabled -- 'qemu-guest-agent.service'
17:22:46 3.252 systemctl 7899 7898 0 /usr/bin/systemctl --system is-enabled -- qemu-guest-agent.service
17:22:46 3.256 systemctl 7900 7897 0 /usr/bin/systemctl --system --quiet is-active -- qemu-guest-agent.service

Interesting, there is a "systemctl is-enabled" call.

And indeed, deb-systemd-invoke will not start the service if it's not enabled:

deb-systemd-invoke:105 (jammy)
# If the job is disabled and is not currently running, the job is not started or restarted.

And of course, closer inspection of the output when installing the package would have told me that already:
Selecting previously unselected package qemu-guest-agent.
(Reading database ... 69980 files and directories currently installed.)
Preparing to unpack .../qemu-guest-agent_1%3a6.2+dfsg-2ubuntu6.15~jammy1_amd64.deb ...
Unpacking qemu-guest-agent (1:6.2+dfsg-2ubuntu6.15~jammy1) ...
Setting up qemu-guest-agent (1:6.2+dfsg-2ubuntu6.15~jammy1) ...
qemu-guest-agent.service is a disabled or a static unit, not starting it. <===============
Processing triggers for man-db (2.10.2-1) ...

And that's why you had to include a specific start of the service in your test case right after installing the package.