Red Hat Bugzilla – Bug 1468001
systemd presets have no effect on fedora-readonly.service
Last modified: 2017-10-11 12:47:09 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):
Steps to Reproduce:
1. create a presets file (e.g., /usr/lib/systemd/system-preset/00-test.preset) containing at least "disable fedora-readonly.*".
3. systemctl status fedora-readonly.service
● 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
Notice that the vendor preset indicates "disabled" (good) but that the service is "active" (bad).
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:
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.
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!
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.)
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.
Let's consolidate the two bugs.
*** This bug has been marked as a duplicate of bug 1493479 ***