Bug 1094935 - util-linux: script and/or trigger should not directly enable systemd units
Summary: util-linux: script and/or trigger should not directly enable systemd units
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: autoenabled-systemd-units
TreeView+ depends on / blocked
 
Reported: 2014-05-06 17:23 UTC by Andy Lutomirski
Modified: 2014-05-12 09:39 UTC (History)
5 users (show)

Fixed In Version: util-linux-2.24.2-4.fc21
Clone Of:
Environment:
Last Closed: 2014-05-12 09:39:39 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Andy Lutomirski 2014-05-06 17:23:46 UTC
My query script thinks that util-linux 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 Karel Zak 2014-05-07 10:53:02 UTC
Well, it's expected that uuidd is running after installation -- I have asked for FESCO exception:

https://fedorahosted.org/fesco/ticket/1308

Comment 2 Pavel Šimerda (pavlix) 2014-05-07 11:10:49 UTC
> Note that uuidd is local-only daemon that uses UNIX socket to listen to libuuid.

Wouldn't socket activation (enabled by default of course) be a suitable solution for this type of services?

Comment 3 Karel Zak 2014-05-07 12:17:34 UTC
It uses socket activation.

Comment 4 Stephen Gallagher 2014-05-07 12:26:40 UTC
Pavel: from the perspective of FESCo, socket activation is equivalent to enabling by default (since the effect is the same from an external point of view: the port is answering).

That said, this restriction is on network services specifically. Since uuidd only listens on a UNIX socket to local requests, it is not required to get an explicit exception.

Comment 5 Karel Zak 2014-05-07 12:31:34 UTC
The exception is unnecessary, uuidd  it belongs to the general exception.

Comment 6 Karel Zak 2014-05-07 12:34:07 UTC
Note that it would be nice to use any white-list with "general exception packages" in the script that scans Fedora packages.

Comment 7 Pavel Šimerda (pavlix) 2014-05-07 12:43:49 UTC
I think this bug still applies, as the services to be run default should be handled according to:

https://fedoraproject.org/wiki/Features/PackagePresets

AFAIK the macros already perform `systemctl preset` internally, so you shouldn't need to use `systemctl enable` but instead there should be a file in the system-presets folder. I can't find a policy though, whether the file should be installed by the package or as part of systemd or whatever.

Comment 8 Pavel Šimerda (pavlix) 2014-05-07 12:45:13 UTC
According to:

# rpm -qf /usr/lib/systemd/system-preset/90-default.preset 
systemd-212-2.fc21.x86_64

I think you should file a bug with systemd to include uuidd.socket in the presets and then remove the `systemct enable` from the spec file.

Comment 9 Karel Zak 2014-05-07 15:37:34 UTC
Good point (and thanks for #1095353).

Comment 10 Andy Lutomirski 2014-05-07 16:25:08 UTC
Using the preset will keep my script from complaining in the future.

Comment 11 Karel Zak 2014-05-12 09:39:39 UTC
Thanks for the hints! 

The problem should be fixed in rawhide now.


Note You need to log in before you can comment on or make changes to this bug.