[Buildroot] [PATCH v5] package/ntp: sntp time sync script

Arnout Vandecappelle arnout at mind.be
Mon Feb 4 08:10:51 UTC 2019



On 04/02/2019 01:27, Carlos Santos wrote:
>> From: "Arnout Vandecappelle" <arnout at mind.be>
>> To: "Matthew Weber" <matthew.weber at rockwellcollins.com>, "buildroot" <buildroot at buildroot.org>
>> Cc: "Oscar Gomez Fuente" <oscargomezf at gmail.com>, "Carlos Santos" <casantos at datacom.ind.br>
>> Sent: Domingo, 3 de fevereiro de 2019 18:00:33
>> Subject: Re: [Buildroot] [PATCH v5] package/ntp: sntp time sync script
> 
>> Hi Matt,
>>
>> I've finally applied to master since it really is a useful feature and it
>> works. However, I have a few additional remarks. Also one for Carlos, the init
>> script dude :-)
>>
>> On 12/12/2018 04:45, Matt Weber wrote:
>> [snip]
>>> +#!/bin/sh
>>> +
>>> +DAEMON="sntp"
>>
>> Carlos, I'm starting to doubt the usefulness of this DAEMON variable. Other
>> variables are prefixed by SNTP_, only this one isn't. In other init scripts you
>> started using PROGRAM instead because it isn't actually a daemon.
>>
>> However, the only reason to make it a variable is to make it easier to copy and
>> adapt an existing init script. But really, doing a search/replace of that string
>> is not so much work. And you anyway need to review the entire file, e.g.
>> /usr/bin/$DAEMON is used which may not be correct.
>>
>> So I'd propose to replace DAEMON with a direct reference to the program. What
>> do you think?
> 
> DAEMON can be useful sometime in the future if we homogenize the scripts
> so well that we can use a template that is sourced after setting a small
> of variables (DAEMON, DAEMON_ARGS, PIDFILE, and so on). Perhaps we should
> use an EXECFILE variable instead of /usr/bin/$DAEMON.

 That's a great counterexample why a template won't work :-) Sometimes it's
/usr/sbin or /bin or /sbin or maybe something else still. So I think making it a
template that can be sourced is going to lead us too far - there are already a
couple of init-script-management tools; if we really want that, we should use
one of those. But we don't want that, we really do want individually maintained
init scripts. However, it's easier to maintain / review them if they follow a
common structure. And my point is: I don't think the DAEMON / PROGRAM / EXECFILE
variable adds much value.

 Regards,
 Arnout



More information about the buildroot mailing list