[systemd-devel] Fwd: Re: [opensuse-packaging] Fwd: [RFC] Preset Files

Andreas Jaeger aj at suse.com
Mon Jul 11 08:22:50 PDT 2011


Asking on the openSUSE lists, I received the following proposal for an 
alternative implementation that I propose for discussion,

Andreas
----------  Forwarded Message  ----------

Subject: Re: [opensuse-packaging] Fwd: [systemd-devel] [RFC] Preset Files
Date: Friday, July 08, 2011, 19:31:07
From: Christian Boltz <opensuse at cboltz.de>
To: opensuse-packaging at opensuse.org

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.

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

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.


Regards,

Christian Boltz

-----------------------------------------
-- 
 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


More information about the systemd-devel mailing list