Starting ntpd in a jail
paul at gromit.dlib.vt.edu
Sat Sep 29 13:32:47 UTC 2018
> On Sep 29, 2018, at 8:00 AM, freebsd-questions-request at freebsd.org wrote:
> Date: Fri, 28 Sep 2018 15:50:16 +0200
> From: Andrea Venturoli <ml at netfence.it>
> To: freebsd-questions at freebsd.org
> Subject: Starting ntpd in a jail
> Message-ID: <8a138f2e-11d4-d890-c28d-72717a9eed3a at netfence.it>
> I'm trying to run ntpd in a jail.
> Before someone points out it won't be able to set time, that's ok :) I
> just want other clients to be able to synchronize with it.
> I can manually "service ntpd start" and it will happily work, but it
> won't start at boot (or if I restart the jail).
> Running "rcorder /etc/rc.d/ntpd" gives the same result in the jail as in
> base (where ntpd starts correctly):
>> rcorder: file `/etc/rc.d/ntpd' is before unknown provision `LOGIN'
>> rcorder: requirement `devfs' in file `/etc/rc.d/ntpd' has no providers.
>> rcorder: requirement `FILESYSTEMS' in file `/etc/rc.d/ntpd' has no providers.
>> rcorder: requirement `ntpdate' in file `/etc/rc.d/ntpd' has no providers.
>> rcorder: requirement `DAEMON' in file `/etc/rc.d/ntpd' has no providers.
> Any hint?
The standard /etc/rc.d/ntpd startup script has the "nojail" KEYWORD in it. This means (according to the rc man page) it will be skipped when determining the rcorder of startup (i.e., it will not be executed when starting up in a jail).
If you want ntpd to start up in a jail you could put a copy of /etc/rc.d/ntpd in /usr/local/etc/rc.d and edit it to remove the "nojail" keyword. You may have to do something similar to its dependencies based upon how the nature of the jail setup.
More information about the freebsd-questions