From owner-freebsd-current@FreeBSD.ORG Thu Oct 7 08:10:09 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 63F5816A4CE for ; Thu, 7 Oct 2004 08:10:09 +0000 (GMT) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 54D5943D39 for ; Thu, 7 Oct 2004 08:10:08 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from localhost (rocky.ip.net.ua [82.193.96.2]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id i978A60P098428; Thu, 7 Oct 2004 11:10:06 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua ([82.193.96.10]) by localhost (rocky.ipnet [82.193.96.2]) (amavisd-new, port 10024) with LMTP id 60515-09; Thu, 7 Oct 2004 11:10:04 +0300 (EEST) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id i9789tAt098397 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 7 Oct 2004 11:09:55 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.13.1/8.13.1) id i978A0il079883; Thu, 7 Oct 2004 11:10:00 +0300 (EEST) (envelope-from ru) Date: Thu, 7 Oct 2004 11:10:00 +0300 From: Ruslan Ermilov To: spam maps Message-ID: <20041007081000.GC79690@ip.net.ua> References: <20041007021819.20276.qmail@web54001.mail.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lCAWRPmW1mITcIfM" Content-Disposition: inline In-Reply-To: <20041007021819.20276.qmail@web54001.mail.yahoo.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at ip.net.ua cc: freebsd-current Subject: Re: 5.3-BETA7: /etc/rc.d/ntpdate not using "$ntpdate_flags" from rc.conf ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 08:10:09 -0000 --lCAWRPmW1mITcIfM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 06, 2004 at 07:18:19PM -0700, spam maps wrote: >=20 > Hello, >=20 > I'm puzzled by the /etc/rc.d/ntpdate script and > I wonder whether the script is wrong, or there > is lack of documentation here. >=20 I'd say lack of reading the documentation. ;) This is from the rc.subr(8) manpage: : rc_flags Flags to start the default command with. Defaults : to ${name}_flags, unless overridden by the environ- : ment variable `flags'. This variable may be : changed by the argument_precmd method. > In /etc/rc.conf, I am using: > ntpdate_enable=3D"YES" > ntpd_enable=3D"YES" > with servers listed in /etc/ntp.conf. >=20 > But I wonder if ntpdate instantly adjusts time > using the "-b" from default ntpdate_flags. >=20 > The flags used by the /etc/rc.d/ntpdate script > are found in this order: >=20 > 1. If /etc/ntp.conf exists and has servers > listed, then extract the servers from here. >=20 =2E.. and no ntpdate_hosts was specified. > 2. If above fails to find servers, then use > servers listed in /etc/rc.conf as > ntpdate_flags=3D"...". >=20 Um no. Everything specified as ntpdate_flags is *always* passed to ntpdate(8). I use ntpdate_flags=3D"-b ". > 3. If all that fails, exit ntpdate without doing > any time/date modifications. >=20 Only if neither of ntpdate_hosts, /etc/ntp.conf, and ntpdate_flags exist and set. > I also wonder whether the default ntpdate_flags > (set to "-b") has any effect at all, since it is > ignored in case 1. >=20 Yes it does, and it becomes a value of ${rc_flags}. if [ -n "$ntpdate_hosts" -o -n "$rc_flags" ]; then echo "Setting date via ntp." ${ntpdate_command:-ntpdate} $rc_flags $ntpdate_hosts fi Run it like this to see the actual command that gets executed: sh -x /etc/rc.d/ntpdate start Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --lCAWRPmW1mITcIfM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBZPnYqRfpzJluFF4RAuTlAJ4q/XadXhpc5z2mRrmestg0K59i6wCdHRR1 RumD2KHTv/8yMhuoK4a7InE= =wk82 -----END PGP SIGNATURE----- --lCAWRPmW1mITcIfM--