-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config files for alternatives? #9
Comments
It makes sense. I have been thinking about rewriting alternatives to make them more modern, and I even have requirements from other teams as well. The problem is that it was always pretty low on my todo list. I will try to find someone on our team who would be willing to work on this. |
both packages pull in nss which fails to export because it contains a symlink (via /etc/alternatives) to p11-kit-trust: /usr/lib64/libnssckbi.so -> /etc/alternatives/libnssckbi.so.x86_64 /etc/alternatives/libnssckbi.so.x86_64 -> /usr/lib64/pkcs11/p11-kit-trust.so When `bdcs-cli compose tar` is executed it errors out on the above link because one of the two files will always be exported first! Ultimately the fix needs to go upstream but this is still very new, so we take the easiest path to let the tests continue working, see: fedora-sysv/chkconfig#9
both packages pull in nss which fails to export because it contains a symlink (via /etc/alternatives) to p11-kit-trust: /usr/lib64/libnssckbi.so -> /etc/alternatives/libnssckbi.so.x86_64 /etc/alternatives/libnssckbi.so.x86_64 -> /usr/lib64/pkcs11/p11-kit-trust.so When `bdcs-cli compose tar` is executed it errors out on the above link because one of the two files will always be exported first! Ultimately the fix needs to go upstream but this is still very new, so we take the easiest path to let the tests continue working, see: fedora-sysv/chkconfig#9
I like the idea, but there are some problems, especially with atomic updates as used by different distributions in different implementations, but maybe also with updating configuration files.
For more background and ideas, please look at: https://github.com/thkukuk/atomic-updates_and_etc/blob/master/README.md If we get this seperated and solved nicely, I will make sure that openSUSE will switch to this alternatives solution. And if we find a more ini style format, SUSE is currently developing a C library to merge such config files for applications, we are currently discussing the requirements of dnf for it with the developers. |
@wgwoods @lnykryn friendly ping... Anyone have any idea when this might be tackled? There's now a library for handling the config file overrides and layering similar to systemd, called libeconf. This is packaged in Fedora already, so this could make it much easier for implementing this. |
@Conan-Kudo Well, a lot of people have this on their "when I have some free time" list for years. So I don't expect that this will be done anytime soon. |
Workaround for [1] while we wait for [2] to get fixed. [1] coreos/fedora-coreos-tracker#676 [2] fedora-sysv/chkconfig#9
Workaround for [1] while we wait for [2] to get fixed. [1] coreos/fedora-coreos-tracker#676 [2] fedora-sysv/chkconfig#9
Workaround for [1] while we wait for [2] to get fixed. [1] coreos/fedora-coreos-tracker#676 [2] fedora-sysv/chkconfig#9
Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This PR is a draft/proposal to kick-off a dicussion on how to solve a longstanding issue with `alternatives` on ostree-based systems. The summarize the underlying issue: `ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. Hence, we need to move to another location. This PR proposes to use /etc/alternatives/state. Some very brief smoketests suggest that this "just works". I added a Dockerfile to the PR to test. Without the patch, the `RUN go ...` would error out as it cannot find `go` in the PATH. BACKWARDS COMPATIBILITY I think we need to worry about backwards compatibility. Some users/workloads may very well depend on the symlinks being stored under /var/lib/alternatives. Colin and I discussed a number of options: 1. Use /var/lib/alternatives if it exists and otherwise use the new location. Pro: Easy to implement, test and maintain. Con: Upgraded and freshly installed systems would behave differently and potentially break users depending on the old behavior. 2. Introduce a new alternatives-ostree (sub)package which would replace the current one. Pro: It would ultimately solve the backwards compatibility issue. Con: Slightly more work as we need to add some #ifdef to the code, conditionally compile the source and add a sub-package. [1] fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This PR is a draft/proposal to kick-off a dicussion on how to solve a longstanding issue with `alternatives` on ostree-based systems. The summarize the underlying issue: `ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. Hence, we need to move to another location. This PR proposes to use /etc/alternatives/state. Some very brief smoketests suggest that this "just works". I added a Dockerfile to the PR to test. Without the patch, the `RUN go ...` would error out as it cannot find `go` in the PATH. BACKWARDS COMPATIBILITY I think we need to worry about backwards compatibility. Some users/workloads may very well depend on the symlinks being stored under /var/lib/alternatives. Colin and I discussed a number of options: 1. Use /var/lib/alternatives if it exists and otherwise use the new location. Pro: Easy to implement, test and maintain. Con: Upgraded and freshly installed systems would behave differently and potentially break users depending on the old behavior. 2. Introduce a new alternatives-ostree (sub)package which would replace the current one. Pro: It would ultimately solve the backwards compatibility issue. Con: Slightly more work as we need to add some #ifdef to the code, conditionally compile the source and add a sub-package. [1] fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This PR is a draft/proposal to kick-off a dicussion on how to solve a longstanding issue with `alternatives` on ostree-based systems. The summarize the underlying issue: `ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. Hence, we need to move to another location. This PR proposes to use /etc/alternatives/state. Some very brief smoketests suggest that this "just works". I added a Dockerfile to the PR to test. Without the patch, the `RUN go ...` would error out as it cannot find `go` in the PATH. BACKWARDS COMPATIBILITY I think we need to worry about backwards compatibility. Some users/workloads may very well depend on the symlinks being stored under /var/lib/alternatives. Colin and I discussed a number of options: 1. Use /var/lib/alternatives if it exists and otherwise use the new location. Pro: Easy to implement, test and maintain. Con: Upgraded and freshly installed systems would behave differently and potentially break users depending on the old behavior. 2. Introduce a new alternatives-ostree (sub)package which would replace the current one. Pro: It would ultimately solve the backwards compatibility issue. Con: Slightly more work as we need to add some #ifdef to the code, conditionally compile the source and add a sub-package. [1] fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This PR is a draft/proposal to kick-off a dicussion on how to solve a longstanding issue with `alternatives` on ostree-based systems. The summarize the underlying issue: `ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. Hence, we need to move to another location. This PR proposes to use /etc/alternatives/state. Some very brief smoketests suggest that this "just works". I added a Dockerfile to the PR to test. Without the patch, the `RUN go ...` would error out as it cannot find `go` in the PATH. BACKWARDS COMPATIBILITY I think we need to worry about backwards compatibility. Some users/workloads may very well depend on the symlinks being stored under /var/lib/alternatives. Colin and I discussed a number of options: 1. Use /var/lib/alternatives if it exists and otherwise use the new location. Pro: Easy to implement, test and maintain. Con: Upgraded and freshly installed systems would behave differently and potentially break users depending on the old behavior. 2. Introduce a new alternatives-ostree (sub)package which would replace the current one. Pro: It would ultimately solve the backwards compatibility issue. Con: Slightly more work as we need to add some #ifdef to the code, conditionally compile the source and add a sub-package. [1] fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/.alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/.alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: fedora-sysv#9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
`ostree container commit` wipes /var and thereby erases the data in /var/lib/alternatives; the directory used to store configs/symlinks of alternatives. /var is not a good place for storing such configs since it won't receive updates on bootc images either. We need to move to another location. Hence, use /etc/alternatives.admindir when running on an ostree-based system unless /var/lib/alternatives is already present; a user may have worked around the problem. This way we enable alternatives to work on ostree-based systems without breaking backwards compat. Fixes: #9 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Background: as part of my ongoing quest to make all RPM scriptlets deterministic, I'm looking for ways to make every common tool that runs in
%pre
or%post
config-file driven rather than code-driven.alternatives
is one of these, and it's one of the few things that doesn't have a config file format already in use. So I'm proposing that either:alternatives
grows its own config file format and drop-in directory, or/usr/sbin/alternatives
.So here's an example of a possible simple config file format:
#
and run to EOLPRIO NAME LINK PATH
PRIO
must be an integer, obviously--install LINK NAME PATH PRIO
+ NAME LINK PATH
--slave LINK NAME PATH
arguments+s SERVICE
--initscript SERVICE
+i
but these are called "services" now)+f FAMILY
(not used above)--family FAMILY
Programs/packages that wanted to install
alternatives
links could ship a config file like, say,/etc/alternatives.conf.d/exim.conf
. The system could then do something liketo perform the equivalent of the
--install ...
commandline, or--remove-from CONF_FILE
to perform the equivalent--remove NAME PATH
action.We could accomplish this by writing a separate wrapper program that parses the config data and translates it into equivalent
alternatives
commandlines, but it seems like this might be something useful to integrate intoalternatives
itself.Does this make sense? Any thoughts, questions, or suggestions? I'll be happy to try to get a patch written to accomplish this if you believe this functionality would be useful.
The text was updated successfully, but these errors were encountered: