Hello,

Here's a diff for the ntpd rc script pre start, to check the config.

Works (for me) with a non-default configuration file too.

Test output below, with a deliberatly mangled alternate file.


Index: ntpd
===================================================================
RCS file: /cvs/src/etc/rc.d/ntpd,v
retrieving revision 1.2
diff -u -p -r1.2 ntpd
--- ntpd        14 Sep 2011 02:36:09 -0000      1.2
+++ ntpd        27 Jun 2015 13:01:36 -0000
@@ -9,4 +9,21 @@ daemon="/usr/sbin/ntpd"
 pexp="ntpd: \[priv\]"
 rc_reload=NO
 
+
+rc_pre()
+{
+       # ntpd [-dnSsv] [-f file]
+       unset ntpd_conf
+       [[ ${daemon_flags} == -*f* ]] &&
+       {
+               for daemon_flag in ${daemon_flags}
+               do
+                       [[ ${daemon_flag} == -* ]] && continue
+                       ntpd_conf="-f ${daemon_flag}"
+                       break
+               done
+       }
+       _rc_do ${daemon} -n ${ntpd_conf}
+}
+
 rc_cmd $1




$ sudo /etc/rc.d/ntpd -d start
doing _rc_parse_conf
doing _rc_quirks
ntpd_flags >-sf /tmp/ntpd.conf<
doing _rc_read_runfile
doing rc_check
ntpd
doing rc_pre
doing /usr/sbin/ntpd -n -f /tmp/ntpd.conf
/tmp/ntpd.conf:5: syntax error
/tmp/ntpd.conf:6: could not resolve "ntp.example.not.uk" # dud listen on
/tmp/ntpd.conf:7: could not resolve "ntp.localdomain"    # dud listen on
/tmp/ntpd.conf:16: syntax error
doing _rc_rm_runfile
(failed)

$ sudo /etc/rc.d/ntpd -d start
doing _rc_parse_conf
doing _rc_quirks
ntpd_flags >-s<
doing _rc_read_runfile
doing rc_check
ntpd
doing rc_pre
doing /usr/sbin/ntpd -n
configuration OK
doing rc_start
doing _rc_write_runfile
(ok)

$ sudo /etc/rc.d/ntpd restart 
ntpd(ok)
ntpd(ok)

Reply via email to