[Buildroot] [PATCH 1/2] dhcpcd: add SysV start-up script

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Fri Nov 3 16:17:48 UTC 2017


Hello,

On Fri, 3 Nov 2017 17:10:57 +0100, Yann E. MORIN wrote:

> > So you want explicitly handling for the "missing configuration file"
> > situation in the init script?
> > 
> > I wanted to avoid explicit handling, and just let the daemon whine (or
> > not) if its config file is missing.  
> 
> The idea is that the script contains sensible defaults, but scans an
> optional file (e.g. /etc/default.d/my-daemon.conf) that a user can
> provide to override the defaults.
> 
> IIRC, that's what was discussed and concluded a while ago (2 years?).
> 
> I would like that users can change the behaviour of a service without
> having to sed/replace the init script.

I think we're not talking about the same thing. I'm not talking
about /etc/default/foobar containing additional shell variables to
tweak the init script behavior.

I'm talking about the configuration file read by the daemon itself
(/etc/lighttpd/lighttpd.conf for example).

For inadyn, we have:

CONFIG=/etc/inadyn.conf
[ ! -f $CONFIG ] && ( echo "The config file "$CONFIG" is missing...exiting now." && exit 2 )

So here we error out.

And for squid, we have:

[ -f /etc/squid.conf ] || exit 0

So we silently exit if there's no configuration file.

I'd like to have a consistent solution for this, and my proposal is to
do nothing in the init script, i.e start the daemon, and let it
explode/blow up/complain/whine if its configuration file is missing.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com



More information about the buildroot mailing list