Bug 1468501

Summary: preset override for user-session services missing compared to system service configuration
Product: [Fedora] Fedora Reporter: Fabio Valentini <decathorpe>
Component: systemdAssignee: systemd-maint
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: carl, fedora, johannbg, lnykryn, msekleta, muadda, s, systemd-maint, zbyszek
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: systemd-245~rc1-2.fc32 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-28 13:57:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1708297    

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.