Bug 1468501 - preset override for user-session services missing compared to system service configuration
Summary: preset override for user-session services missing compared to system service ...
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: 1708297
TreeView+ depends on / blocked
Reported: 2017-07-07 09:16 UTC by Fabio Valentini
Modified: 2020-03-03 07:49 UTC (History)
9 users (show)

Fixed In Version: systemd-245~rc1-2.fc32
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2020-02-28 13:57:05 UTC
Type: Bug

Attachments (Terms of Use)

Description Fabio Valentini 2017-07-07 09:16:00 UTC
By default, systemd system services are disabled after RPM package installation - unless they ship a preset override file. This is handled by the file "/usr/lib/systemd/system-preset/99-default-disable.preset".

No such policy/preset exists for user session services.

When using the systemd scriptlets from the Packaging Guidelines (in a package which ships a user session service), the "%systemd_user_post" macro is triggered on package installation, and thus enables the service in question for _ALL_ users on the system globally - including root, gdm, and others (which is obviously not the desired behavior).

I suggest shipping a user-preset file equivalent to the "system-preset/99-default-disable.preset" file to prevent this unexpected misbehavior.

Right now, one has to ship a preset file to explicitly prevent user services from being activated, which is exactly the opposite of what has to be done for system services (shipping a preset explicitly enabling it on installation, otherwise it's disabled by default).

Version-Release number of selected component (if applicable):
All systemd versions in fedora 25, 26, rawhide are affected.

Comment 1 Jan Kurik 2017-08-15 08:22:32 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

Comment 2 Ben Cotton 2018-11-27 18:32:28 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Zbigniew Jędrzejewski-Szmek 2019-04-09 10:46:14 UTC
I'm working on a comprehensive fix for this.

Comment 4 Fabio Valentini 2019-04-09 20:23:33 UTC
Good to know, thanks for the update!

Comment 5 Zbigniew Jędrzejewski-Szmek 2020-02-28 13:57:05 UTC
This was fixed, but I forgot to close this bug.

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