Systemd programming part 1: modularity and configuration
Systemd programming part 1: modularity and configuration
Posted Feb 5, 2014 23:54 UTC (Wed) by zuki (subscriber, #41808)Parent article: Systemd programming part 1: modularity and configuration
Posted Feb 6, 2014 4:40 UTC (Thu)
by zenaan (guest, #3778)
[Link] (2 responses)
Also:
> While systemd can certainly read these same configuration files (with the EnvironmentFile directive) and can expand environment variables in command line arguments to programs, it lacks any sophistication. Non-optional parameters are easily handled, so:
So change MOUNTD_PORT to MOUNTD_PORT_ARG:
/usr/sbin/rpc.mountd $MOUNTD_PORT_ARG ...
Where eg, /etc/default/my-service.conf contains eg:
MOUNTD_PORT_ARG="-p 12345"
I know it's clunky, but it is trivial to implement, and the author Neil _is_ talking transition here ("longer term" vs "short-term")...
Posted Feb 6, 2014 6:00 UTC (Thu)
by raven667 (subscriber, #5198)
[Link] (1 responses)
Posted Feb 6, 2014 6:49 UTC (Thu)
by raven667 (subscriber, #5198)
[Link]
Now that I've read the article I understand Neil's point but it is my opinion that giving the system admin good tools to audit changes which diverge from the default is sufficient, although sure there could be an even better system which doesn't even require the audit and integration, I'd rather keep the system simple, his example of having units run scripts to generate environment files which alter the behavior of other units is too abstract and complex (hacky) for me.
The straightforwardness of systemd-delta appeals to me, in the same way that other tools which show you diffs between the packaged and modified version of a config and allow you to merge the changes when you update.
Posted Feb 7, 2014 21:54 UTC (Fri)
by bfields (subscriber, #19510)
[Link] (1 responses)
Yeah, I think that would be better in the long run.
Code at git://linux-nfs.org/nfs-utils, patches to linux-nfs@vger.kernel.org....
Posted Feb 7, 2014 22:45 UTC (Fri)
by neilbrown (subscriber, #359)
[Link]
Make sure they include plugins for all knows configuration UIs to work with this new config file.
Given that
- configurators can already read/write environment files
there seems little point in creating new config files for any configuration that can be provided by a simple environment file.
What is why I won't be providing patches to read config files.
Systemd programming part 1: modularity and configuration
>⋅
> /usr/sbin/rpc.nfsd -n $USE_KERNEL_NFSD_NUMBER
>⋅
> would work as expected, but optional parameters cannot be managed so easily. While the Bourne shell (which interprets SysVinit scripts) and Upstart would both support:
>⋅
> /usr/sbin/rpc.mountd ${MOUNTD_PORT:+-p $MOUNTD_PORT}
Systemd programming part 1: modularity and configuration
Systemd programming part 1: modularity and configuration
Systemd programming part 1: modularity and configuration
Systemd programming part 1: modularity and configuration
- systemd can already load them into the environment, as can the shell
- daemons can get them out of the environment using "getenv()", which is already in the standard library
