Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Aug 2002 20:54:49 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Jeff Penn <jeff@jrpenn.demon.co.uk>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Configuring ntpd on a dialup workstation
Message-ID:  <20020821195449.GA23470@happy-idiot-talk.infracaninophi>
In-Reply-To: <20020821184732.GA365@jrpenn.demon.co.uk>
References:  <20020821184732.GA365@jrpenn.demon.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Aug 21, 2002 at 07:47:32PM +0100, Jeff Penn wrote:
> I'm having problems figuring out how to set up my system to run ntpd on
> a dialup workstation.
> 
> Unless root initiates the ppp connection I get:
> 
> Aug 21 18:49:27 jrpenn ntpd: ntpd: must be run as root, not uid 1001
> 
> I tried chmod 4555 /usr/sbin/ntpd without any success.
> 
> /etc/ppp/ppp.linkup:
> provider:
>  !bg sendmail -q
>  !bg /usr/sbin/ntpd -q -p /var/run/ntpd.pid

Unfortunately, ntpd is designed to run continually, not to be stopped
and started as dialup links go up and down.  It's pretty difficult to
keep your system clock really accurate unless you have an always-on
connection --- you've got to sample an external time source at fairly
regular intervals not only to correct the clock but to predict and
counteract the way the clock drifts with time.

If you're going to use ntpd on a dial up, what you really don't want
to happen is for ntp packets to trigger dialing up every few minutes.
You need to set up some dial filters in your ppp.conf (ppp(1)):

    set filter dial 0 deny udp src eq 123 dst eq 123

Given that, you can just start up ntpd as usual, by setting
'xntpd_enable="YES"' in /etc/rc.conf. You can also tweak the
/etc/ntp.conf file (ntp.conf(5)) to make it a bit more dial friendly:

    server ntp0.example.com burst

Having said that, and while it's certainly not impossible to run ntpd
on a dial-up, but you may find that it's just as effective to run
ntpdate out of ppp-linkup.  It depends how often and how long you're
on-line.
 
    provider:
      !bg /usr/sbin/sendmail -q
      !bg /usr/sbin/ntpdate -s ntp0.example.com ntp1.example.co.uk

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
                                                      Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020821195449.GA23470>