Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH-NEXT 1/2] chrony: S49chrony: support a defaults file
@ 2018-05-28 13:22 Peter Korsgaard
  2018-05-28 13:22 ` [Buildroot] [PATCH-NEXT 2/2] chrony: S49chrony: drop /etc/chrony.conf check Peter Korsgaard
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Korsgaard @ 2018-05-28 13:22 UTC (permalink / raw)
  To: buildroot

For specifying custom options to chrony.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 package/chrony/S49chrony | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/chrony/S49chrony b/package/chrony/S49chrony
index 6215acc4aa..5abb3b2582 100755
--- a/package/chrony/S49chrony
+++ b/package/chrony/S49chrony
@@ -2,12 +2,14 @@
 #
 # Start chrony
 
+[ -r /etc/default/chrony ] && . /etc/default/chrony
+
 [ -f /etc/chrony.conf ] || exit 0
 
 case "$1" in
   start)
 	printf "Starting chrony: "
-	chronyd && echo "OK" || echo "FAIL"
+	chronyd $CHRONY_ARGS && echo "OK" || echo "FAIL"
 	;;
   stop)
 	printf "Stopping chrony: "
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH-NEXT 2/2] chrony: S49chrony: drop /etc/chrony.conf check
  2018-05-28 13:22 [Buildroot] [PATCH-NEXT 1/2] chrony: S49chrony: support a defaults file Peter Korsgaard
@ 2018-05-28 13:22 ` Peter Korsgaard
  2018-05-28 15:21   ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Korsgaard @ 2018-05-28 13:22 UTC (permalink / raw)
  To: buildroot

With CHRONY_ARGS in /etc/default/chrony, chrony may asked to use an
alternative configuration file (with the -f option), so drop the explicit
/etc/chrony.conf check.

In case the configuration file isn't present chrony will anyway loudly
complain which is preferable to this silent failure:

chronyd -f /non/existing/file.conf
Could not open configuration file /non/existing/file.conf : No such file or directory

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 package/chrony/S49chrony | 2 --
 1 file changed, 2 deletions(-)

diff --git a/package/chrony/S49chrony b/package/chrony/S49chrony
index 5abb3b2582..f75233fe5e 100755
--- a/package/chrony/S49chrony
+++ b/package/chrony/S49chrony
@@ -4,8 +4,6 @@
 
 [ -r /etc/default/chrony ] && . /etc/default/chrony
 
-[ -f /etc/chrony.conf ] || exit 0
-
 case "$1" in
   start)
 	printf "Starting chrony: "
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH-NEXT 2/2] chrony: S49chrony: drop /etc/chrony.conf check
  2018-05-28 13:22 ` [Buildroot] [PATCH-NEXT 2/2] chrony: S49chrony: drop /etc/chrony.conf check Peter Korsgaard
@ 2018-05-28 15:21   ` Thomas Petazzoni
  2018-05-28 18:21     ` Peter Korsgaard
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2018-05-28 15:21 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon, 28 May 2018 15:22:58 +0200, Peter Korsgaard wrote:
> With CHRONY_ARGS in /etc/default/chrony, chrony may asked to use an
> alternative configuration file (with the -f option), so drop the explicit
> /etc/chrony.conf check.
> 
> In case the configuration file isn't present chrony will anyway loudly
> complain which is preferable to this silent failure:
> 
> chronyd -f /non/existing/file.conf
> Could not open configuration file /non/existing/file.conf : No such file or directory
> 
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>

Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

I really hate those stupid checks, they cause more harm than good. So
it's great to remove those checks.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH-NEXT 2/2] chrony: S49chrony: drop /etc/chrony.conf check
  2018-05-28 15:21   ` Thomas Petazzoni
@ 2018-05-28 18:21     ` Peter Korsgaard
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2018-05-28 18:21 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:

 > Hello,
 > On Mon, 28 May 2018 15:22:58 +0200, Peter Korsgaard wrote:
 >> With CHRONY_ARGS in /etc/default/chrony, chrony may asked to use an
 >> alternative configuration file (with the -f option), so drop the explicit
 >> /etc/chrony.conf check.
 >> 
 >> In case the configuration file isn't present chrony will anyway loudly
 >> complain which is preferable to this silent failure:
 >> 
 >> chronyd -f /non/existing/file.conf
 >> Could not open configuration file /non/existing/file.conf : No such file or directory
 >> 
 >> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>

 > Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

 > I really hate those stupid checks, they cause more harm than good. So
 > it's great to remove those checks.

Yes, indeed. Committed both to next, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-28 18:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-28 13:22 [Buildroot] [PATCH-NEXT 1/2] chrony: S49chrony: support a defaults file Peter Korsgaard
2018-05-28 13:22 ` [Buildroot] [PATCH-NEXT 2/2] chrony: S49chrony: drop /etc/chrony.conf check Peter Korsgaard
2018-05-28 15:21   ` Thomas Petazzoni
2018-05-28 18:21     ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox