Bug 1094927

Summary: qemu: script and/or trigger should not directly enable systemd units
Product: [Fedora] Fedora Reporter: Andy Lutomirski <luto>
Component: qemuAssignee: Fedora Virtualization Maintainers <virt-maint>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: amit.shah, berrange, cfergeau, dwmw2, itamar, pbonzini, rjones, scottt.tw, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-06 17:52:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1090684    

Description Andy Lutomirski 2014-05-06 17:23:13 UTC
My query script thinks that qemu has a script or trigger that directly enables a systemd unit using 'systemctl enable'.  It probably should not.  Please update this packages to use the macroized scriptlet (https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd).

If your package has an exception from FESCo permitting it to enable
itself, please make sure that the service in question is listed in the
appropriate preset file.

There is a general exception described here:

https://fedoraproject.org/wiki/Starting_services_by_default

If your package falls under the general exception, then it is possible
that no change is required.  Nevertheless, if you are relying on the
exception, please make sure that your rpm scripts are sensible.  The
exception is:

In addition, any service which does not remain persistent on the system (aka, it "runs once then goes away"), does not listen to incoming connections during initialization, and does not require configuration to be functional may be enabled by default (but is not required to do so). An example of "runs once then goes away" service is iptables.

Given that this issue can affect Fedora 20 users who install your
package as a dependency, this bug should be fixed in Fedora 20 and
Rawhide.

Comment 1 Richard W.M. Jones 2014-05-06 17:52:45 UTC
qemu starts these services:

- ksm/ksmtuned (in the 'ksm' subpackage)

- qemu-guest-agent (in the 'qemu-guest-agent' subpackage)

The exemption is: "If a service does not require configuration
to be functional and does not listen on a network socket".

This applies to KSM, since while you can configure KSM, it has
defaults and is a useful service and does not listen on network
sockets.

qemu-guest-agent only listens on the virtio-serial port when the
host administrator adds the virtio-serial port to the guest.
virtio-serial ports are not network sockets, so the exemption
applies, but in any case: If the host administrator doesn't add
the virtio-serial port to the guest, the service won't do anything
even if it is enabled.  If the administrator does create the
virtio-serial port, then they want the guest agent to start
automatically.

Therefore, closing this as NOTABUG.

Comment 2 Andy Lutomirski 2014-05-06 17:55:54 UTC
OK with me.

I'm not sure I agree with the decision that KSM should be automatically enabled, since it tends to pointless suck CPU when there's just one guest running, but that's a separate issue :)