[systemd-devel] logind.conf.d?

josh at joshtriplett.org josh at joshtriplett.org
Tue May 20 15:43:06 PDT 2014


On Tue, May 20, 2014 at 07:12:02PM +0200, Lennart Poettering wrote:
> On Fri, 16.05.14 12:58, Josh Triplett (josh at joshtriplett.org) wrote:
> 
> > I'd like to add support for /etc/systemd/logind.conf.d, parsed after
> > /etc/systemd/logind.conf.  My specific use case: I'd like to be able to
> > create a simple configuration package I can install on my systems that
> > changes the logind configuration by dropping in a snippet, rather than
> > hand-editing logind.conf.
> > 
> > Does that sound like a reasonable addition?  Happy to write the patch if
> > so.
> 
> Hum, so I must say that I am not enthusiastic about the idea, but I do
> see your usecase, and I can't come up with a reason to reject such a
> patch...
> 
> Hence, go ahead, I'll merge a good patch for it.

Thanks; will do.

> Please try to add this generically to conf-parser.c, but make it
> optional, so that can disable this for example for unit files, where we
> actually want to keep track of the drop-ins (and already do that) and
> thus wouldnt use the generic version anyway... Or in other words, if we
> add this for logind, we need to add it for journald, timesyncd,
> ... too...

As far as I can tell, systemd already has a standard idiom for parsing
configuration .d directories: call conf_files_list_nulstr (if you have
multiple directories) or conf_files_list/conf_files_list_strv (if you
just have one), and loop over the resulting configuration files.  I'd
intended to make logind do the same thing, in manager_parse_config_file,
changing the single parse call to a simple loop.  I'd expect the code
patch to be extremely short, and the documentation patch to be larger
than the code.

Are you looking for a generic function similar to config_parse, such as
config_parse_many, which combines a call to conf_files_list_* and a loop
calling config_parse on each result?

- Josh Triplett


More information about the systemd-devel mailing list