Bug 1468001 - systemd presets have no effect on fedora-readonly.service
systemd presets have no effect on fedora-readonly.service
Status: CLOSED DUPLICATE of bug 1493479
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: David Kaspar [Dee'Kej]
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2017-07-05 14:35 EDT by John Florian
Modified: 2017-10-11 12:47 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-10-11 12:47:09 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description John Florian 2017-07-05 14:35:02 EDT
Description of problem:
I wish to replace/augment the fedora-readonly.service with one of my own design.  Despite having a systemd presets file which has disables fedora-readonly.service and enables mine, I find that fedora-readonly.service remains active.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. create a presets file (e.g., /usr/lib/systemd/system-preset/00-test.preset) containing at least "disable fedora-readonly.*".
2. reboot
3. systemctl status fedora-readonly.service

Actual results:
● fedora-readonly.service - Configure read-only root support
   Loaded: loaded (/usr/lib/systemd/system/fedora-readonly.service; static; vendor preset: disabled)
   Active: active (exited) since Wed 2017-07-05 14:02:06 EDT; 8min ago

Expected results:
Notice that the vendor preset indicates "disabled" (good) but that the service is "active" (bad).

Additional info:
I believe the fault rests with initscripts shipping /lib/systemd/system/local-fs.target.wants/fedora-readonly.service when it would be preferable to simply have the following in the fedora-readonly.service unit file:

Comment 1 Zbigniew Jędrzejewski-Szmek 2017-07-05 15:22:30 EDT
There's two things here:

1. Changing presets and rebooting does not change whether the service is enabled or not. Presets are only used when a package is initially installed (or when systemctl preset is called manually). So for your 00-test.preset config to take effect, you'd need to call systemctl preset yourself.

2. If we ignore point 1., it is true that fedora-readonly.service is enabled "permanently" and cannot be configured through presets. It probably should. To do that, we'll need two changes: first add fedora-readonly.service to the presets distributed in fedora-release, and then update the initscripts package to enable it using presets.

Considering that properly fixing this is going to take a while, for now you can just do 'systemctl mask fedora-readonly.service' to disable it.
Comment 2 John Florian 2017-07-05 15:37:48 EDT
I concur and think this should happen.  It took me a while to hunt this down with everything seemingly contradicting my expectations.  Point #1 is valid, but not really the issue here for me because this is all occurring in a live spin used for embedded systems.  Thus the package is being installed anew for my tests.

Thanks for the quick feedback!
Comment 3 John Florian 2017-07-10 08:46:58 EDT
Is there anything I can help do to move this along?  (I don't have any authority to improve Fedora packages beyond providing patches -- I've long meant to go through the steps but never quite get there.  Still I'm willing to help in any way I can.)
Comment 4 Zbigniew Jędrzejewski-Szmek 2017-07-10 10:06:38 EDT
Thanks for the offer to help. In this particular case the change is simple, but it's spread out over multiple components (fedora-release, initscripts), so the trouble is in coordinating all the changes. I just heard back from the initscripts maintainers and I'll be pushing those changes through.

If you want to get involved in Fedora, I'd be happy to help. I'm a "packaging sponsor". If you are interested, please drop a note (my bugzilla e-mail is OK), what you are interested in, and we can work something out.
Comment 5 Zbigniew Jędrzejewski-Szmek 2017-07-10 19:42:00 EDT
Comment 6 Zbigniew Jędrzejewski-Szmek 2017-10-11 12:47:09 EDT
Let's consolidate the two bugs.

*** This bug has been marked as a duplicate of bug 1493479 ***

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