Subject: Re: ntpd in chroot
To: None <paul@whooppee.com>
From: Jeff Thieleke <thieleke@yahoo.com>
List: current-users
Date: 02/22/2002 22:13:20
Paul Goyette wrote:
> 
> 1. Make sure you have the latest and greatest /dev/MAKEDEV
> 2. Run it to make sure you have created the /dev/clockctl device
> 3. Make sure your kernel config has
> 
>         pseudo-device   clockctl
> 
> When running chroot, you can't use the normal privileged mechanisms for
> adjusting the clock, so you have to use the pseudo-device.


I am trying to get chroot'ed ntpd to work on my i386 current system, but
something isn't clicking, because ntp can't seem to update the clock. 
Non-chroot'ed works fine, but as soon as it enable chroot ntpd in
rc.conf and restart ntpd, the clock starts drifting.


Here is my setup:

* i386 1.5ZA kernel with "pseudo-device   clockctl"

* /etc/rc.conf:
   ntpdate=YES             ntpdate_flags="-b -s clock.home.net"
   ntpd=YES
   ntpd_chrootdir="/var/chroot/ntpd"
 
* ls -l /dev/clockctl:
   crw-rw----  1 root  ntpd  89, 0 Feb 22 17:37 /dev/clockctl

* ls -lR /var/chroot/ntpd:
   total 2
   drwxr-xr-x  2 root  wheel  512 Feb 22 19:49 dev/
   drwxr-xr-x  4 root  wheel  512 Feb 22 19:48 var/

* /var/chroot/ntpd/dev:
   total 0
   crw-rw----  1 root  ntpd  89, 0 Feb 22 17:37 clockctl

* /var/chroot/ntpd/var:
   total 2
   drwxrwxr-x  2 root  ntpd  512 Feb 22 21:49 db/
   drwxrwxr-x  2 root  ntpd  512 Feb 22 19:48 run/

   /var/chroot/ntpd/var/db:
   total 1
   -rw-r--r--  1 ntpd  ntpd  6 Feb 22 21:49 ntp.drift

* id ntpd
    uid=15(ntpd) gid=15(ntpd) groups=15(ntpd)


My /etc/rc.d files are up to date is ntpd(8).  Any ideas on what could
be going wrong?




Jeff Thieleke