On 07/07/2011 03:33 AM, Andreas Jaeger wrote:
On Wednesday, July 06, 2011 21:28:21 Robert Schweikert wrote:
<snip>
More specifically this is how it should work: We'd have a directory /lib/systemd/system.preset/. By default it would be empty (or not even exist), which for simplicity reasons would mean "enable everything installed" (i.e. the Debian policy). Then, if distros or spins want to change what is enabled by default, they'd drop in a file (or multiple, which might be useful for a desktop spin and a graphical design spin where the latter is a superset of the former) in that directory. The file would be a trivial text file with lines like this:
<snip> disable avahi-daemon.service enable cups.service disable * </snip>
Then, we'd add a new command to "systemctl" called "systemctl preset". It would be equivalent to a "systemctl enable" if the unit file passed is listed in any of the preset files on lines prefixed with "enable", or be like a "systemctl disable" if it is listed with a prefix of "disable". Simple globbing would be supported. If no entry is found "systemctl preset" would be synonymous with "systemctl enable".
Generally I think this is a good idea, although the approach appears a bit simplistic and stuffing everything into one directory is probably not so great either.
In another response there was mention of /etc/systemd to separate configurations, that's a step in the right direction. Still there would need to be some precedence rules if there are multiple files. For example if I have 3 files, a.preset, b.preset, and c.preset as follows:
The order is alphabetically if there are several files, like udev does it today.
But for udev the order is less critical
So, I guess we add a 99.openSUSE rule that does "disable *" as the last one.
a.preset enable cups.service
b.preset disable cups.service
c.preset enable cups.service
Is the service now enabled or disabled, probably depends on the processing order. But alpha sorting would not be a good choice as that is obviously locale specific and then has the potential of changing the behavior of the system as far as running services is concerned just based on the locale, that's just not correct.
The locale systemd runs under is the C locale - and if you use numbers, everything is fine.
OK, did not know that and was not part of the original message. Well, using numbers works, still leaves one parsing all files for a specific service and then figuring out which one is processed last and wins. Allowing only one file or enable/disable pair of files makes that task a lot easier. Robert -- Robert Schweikert MAY THE SOURCE BE WITH YOU SUSE-IBM Software Integration Center LINUX Tech Lead rjschwei@suse.com rschweik@ca.ibm.com 781-464-8147 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org