Skip to contentSkip to conversation

chrony: S49chrony: support a defaults file

PATCH New Peter Korsgaard 2 participants 4 messages May 28, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 chrony: S49chrony: support a defaults file

For specifying custom options to chrony.

---
 package/chrony/S49chrony | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
package/chrony/S49chrony +3 -1
index 6215acc4aa..5abb3b2582 100755
@@ -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: "
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/2 chrony: S49chrony: drop /etc/chrony.conf check

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

---
 package/chrony/S49chrony | 2 --
 1 file changed, 2 deletions(-)
package/chrony/S49chrony +0 -2
index 5abb3b2582..f75233fe5e 100755
@@ -4,8 +4,6 @@
 
 [ -r /etc/default/chrony ] && . /etc/default/chrony
 
-[ -f /etc/chrony.conf ] || exit 0
-
 case "$1" in
   start)
 	printf "Starting chrony: "
Signature · 1 line
2.11.0
#2 lore raw

PATCH 2/2 chrony: S49chrony: drop /etc/chrony.conf check

Hello,

Quoted 11 lines · Peter Korsgaard

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

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

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH 2/2 chrony: S49chrony: drop /etc/chrony.conf check

Quoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello,

Quoted 10 lines · Peter Korsgaard

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

Quoted 6 lines
Quoted 1 line

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.

Signature · 1 line
Bye, Peter Korsgaard