Mailinglist Archive: opensuse-packaging (134 mails)

< Previous Next >
Re: [opensuse-packaging] Fwd: [systemd-devel] [RFC] Preset Files
On Friday, July 08, 2011 19:31:07 Christian Boltz wrote:
Hello,

on Freitag, 8. Juli 2011, Robert Schweikert wrote:
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.

There is another way that can even avoid reading file contents ;-)

I propose to use two subdirectories "enabled" and "disabled", and then
just put empty files there, with filename = service name.

SystemD has already the enabled directory.

The proposal we're discussing here is the proposal on how to define which
service to install at a new installation.

In other words: "touch disabled/cupsd.service" would mean cupsd is
disabled by default, and "touch enabled/sshd.service" would enable sshd
by default.

The default behaviour (if there is no service-specific default set)
could also stored with this method - just "touch enabled/DEFAULT".

Advantages of this method:
- you know exactly which files you have to check for a service - just
check for disabled/$service_name and enabled/$service_name.
- getting a full list for all services should be fast because you only
have to read the content of two directories, not any file content.
- easy to handle in packaging
- you'll never have any problems with invalid syntax inside the config
files ;-))
- you'll never get headache with file ordering

You could do exactly the same with the other proposal.

Just have a single file for each service
01_ssh.service
with enable/disable ssh in it - and the 99_default file.

The only thing my proposal doesn't solve is if enabled or disabled
should win if both exist - but this issue exists in all proposals I've
seen until now. It's probably something that should be (or already is)
hardcoded in systemd.

Andreas
--
Andreas Jaeger, Program Manager openSUSE
aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups