Re: ntpd with flags in rc.conf
Zbigniew Szalbot wrote: I have a question about ntpd. HOw is the time adjusted? Gradually over time? Because I can see 30-second difference between my pc and FBSD machine. Will it be minimized in the longer run? Thanks! You're best off directing followup questions back to freebsd-questions as you may well get answers quicker than if you just ask me! ntpd adjusts time slowly, but the -g option should make it set the time correctly when it starts from when it should keep in sync. Set --g in your ntpd_flags and then as root run sh /etc/rc.d/ntpd restart With -g it can still take a while (several minutes) before ntpd trusts its servers enough to set the time, Many people, I believe, use ntpdate to set the time once at startup and then use ntpd to keep it in sync. (Ignore the comment on the manual page for ntpdate about it being deprecated. It has said that for a long time and shows no sign of going away). I believe ntpdate will pick up servers from your ntpd.conf. The man page for ntpd has more info on how ntpd keeps the time, and also check out ntpdc which can show you what ntpd is doing (which servers it's using and stuff). When you say the time on your PC is 30 seconds different, do you mean a Windows pc? Maybe it's the one that's wrong, or maybe your local ntpd isn't finding any servers. As root: ntpdc -c dmpeers should get you a list of the servers ntpd is polling and a * shows the one it is currently trusting, if i recall. --Alex ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: ntpd with flags in rc.conf
On Wed, Oct 11, 2006 at 07:28:15PM +0200, Zbigniew Szalbot wrote: Hello, I read this in the handbook: To ensure the NTP server is started at boot time, add the line ntpd_enable=YES to /etc/rc.conf. If you wish to pass additional flags to ntpd(8), edit the ntpd_flags parameter in /etc/rc.conf. Now, I understand that the additional flag may be for example pid (-p /var/run/ntpd.pid). So how do I put that flag in /etc/rc.conf where I have ntpd_enable=Yes? Many thanks for your advice! -- Zbigniew Szalbot ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] From man rc.conf: ntpd_flags (str) If ntpd_enable is set to ``YES'', these are the flags to pass to the ntpd(8) daemon. Mine is: ntpd_flags= -c /etc/ntp.conf -p /var/run/ntpd.pid -- = Sang-Kil (Sam) Suh ( ext. 262 ) [EMAIL PROTECTED] Agnicorp Inc. 487 Adelaide Street West, Suite 200M5V 1T4 Telephone: 416.203.7838 Facsimile: 416.203.8837 = ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: ntpd with flags in rc.conf
Hello Zbigniew, Wednesday, October 11, 2006, 5:28:15 PM, you wrote: Hello, I read this in the handbook: To ensure the NTP server is started at boot time, add the line ntpd_enable=YES to /etc/rc.conf. If you wish to pass additional flags to ntpd(8), edit the ntpd_flags parameter in /etc/rc.conf. Now, I understand that the additional flag may be for example pid (-p /var/run/ntpd.pid). So how do I put that flag in /etc/rc.conf where I have ntpd_enable=Yes? ntpd_flags=-p /var/run/ntpd.pid Many thanks for your advice! -- Zbigniew Szalbot ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] -- Best regards, Duanemailto:[EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: ntpd with flags in rc.conf
Zbigniew Szalbot wrote: I read this in the handbook: To ensure the NTP server is started at boot time, add the line ntpd_enable=YES to /etc/rc.conf. If you wish to pass additional flags to ntpd(8), edit the ntpd_flags parameter in /etc/rc.conf. Now, I understand that the additional flag may be for example pid (-p /var/run/ntpd.pid). So how do I put that flag in /etc/rc.conf where I have ntpd_enable=Yes? Firstly, you should check what default flags there are already. For 90% of apps the defaults will be right for you. Look in /etc/defaults/rc.conf for ntpd_flags and you find: ntpd_flags=-p /var/run/ntpd.pid -f /var/db/ntpd.drift In many instances, the right thing is to *add* to rather than replace the default flags. Let's say you wanted to add a -g to the default flags for ntpd_flags: ntpd_flags=${ntpd_flags} -g That way, if the default flags need to change for some reason, you still keep up with the defaults and just add your own local customisation. If you cut-and-paste the default value out of /etc/defaults/rc.conf then you may not notice when that value changes. --Alex PS rc.conf is just a shell script, so all variable assignments follow the rules you can find in man sh. Don't put anything too clever in there, though, as this file is read many, many times when the system starts up (once per /etc/rc.d/* file at least) so anything like an echo, for example, will be executed many times. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]