Open jouvin opened 8 years ago
@jouvin Are you planning a new component so people can run them side-by-side during the transition? cf. #648 I think it would be worth considering having a single component that combines both symlink and dirperm since at present it's perfectly possible to get yourself into a situation where dirperm and symlink try to replace the same path, and the ordering of dirperm and symlink is dependent on how a site configures their depends.
Currently I was more thinking at rewriting symlink in such a way that it is based on a dict and still remain backward compatible with the old schema (I have not tested my ideas but I think it should be doable).
But I have also been thinking that it could be good/useful to merge dirperm and symlink.We could use the ncm-system
approach with ncm-chkconfig
: a new configuration modules with a clean schema able to digest the schema of the legacy configuration modules. What do you think about it?
One of the question regarding the schema is the need, if any, of operation ordering. I think the reason for using a list rather than a dict in both configuration module was to be able to address this need. If moving to a dict, it would be painful to invent a complex dependency description... Can we consider that processing the dict entries in the key alphabetical order (the key being the path) is enough? I tend to think that yes as I think the only important thing is to ensure you process the parents before the children...
for the rewrite, a few remarks/requests
ncm-postgresql
) :smile: ncm-systemd
: ncm-systemd does not work on EL6, so ncm-chkconfig is not replaced by ncm-systemd entirely. this component should be able to actually replace it or run in parallel. so it would certainly be nice wrt migration from old ncm-symlink/ncm-dirperm, i don't consider it a requirement. (it's certainly a lot more work, including understanding what and how the old components worked in the first place)/system/services
instead of configuring them directly under the component. not sure if this applies here as well, but better decide on the location early (i have no real preference either way).ncm-ncd
is pretty clean and portable, could become a CAF::Resolv
). i don;t think order will be required much, and certainly not more complex than what ncm-ncd
can do.I think we basically agree. Personally, not surprising, I think that if we start a new component (and I think this is a good proposal), ensuring backward compatibility with components it replaces is critical. In the template library for example both of these configuration modules are used a lot and it would be too much time trying to edit any template to get rid of the legacy config modules. My idea is a new component, probably with a new schema, that register for changes to the configuration part of the legacy ones and do what is appropriate to process the information provided according to the schema of the legacy components (probably converting it to the new one when starting to keep the code clean). I'll see if I managed to come with a prototype in the coming weeks...
In terms of order of processing, my thought was that sorting the paths by length of components and processing in order of increasing length would be both useful and safer? At the moment I think you can run into problems where a symlink higher up the tree can cause dirperm to have different effects depending on the order in which the components are run. To give an example/unit test:
symlink = /var/foo -> /opt/foo
directory = /var/foo/bar, mode = 1777
should result in /opt/foo/bar with mode 1777 because /var/foo has fewer components than /var/foo/bar and therefore /var/foo is processed first.
Good remark! The sorting order may be added as an option.
ncm-symlink
deserves a full rewrite based ongetTree()
API and addressing all the ncm-symlink issues currently open, in particular #288 about ensuring that a symlink definition cannot be added twice to the configuration, leading to unpredictable results.