Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Sep 2018 09:32:38 -0400
From:      Paul Mather <paul@gromit.dlib.vt.edu>
To:        freebsd-questions@freebsd.org
Subject:   Re: Starting ntpd in a jail
Message-ID:  <06B45161-72E3-49CA-9322-1D7D788928E5@gromit.dlib.vt.edu>
In-Reply-To: <mailman.83.1538222402.83437.freebsd-questions@freebsd.org>
References:  <mailman.83.1538222402.83437.freebsd-questions@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

Andrea,

> On Sep 29, 2018, at 8:00 AM, freebsd-questions-request@freebsd.org wrote:
> 
> Date: Fri, 28 Sep 2018 15:50:16 +0200
> From: Andrea Venturoli <ml@netfence.it>
> To: freebsd-questions@freebsd.org
> Subject: Starting ntpd in a jail
> Message-ID: <8a138f2e-11d4-d890-c28d-72717a9eed3a@netfence.it>
> 
> Hello.
> 
> 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.

Cheers,

Paul.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?06B45161-72E3-49CA-9322-1D7D788928E5>