Starting ntpd in a jail

Andrea Venturoli ml at netfence.it
Sat Sep 29 10:51:37 UTC 2018


On 9/29/18 11:58 AM, Lorenzo Salvadore via freebsd-questions wrote:

> I think your problem might be in the moment at which /bin/sh /etc/rc is executed.
> As you probably know, there is a difference between creating a jail and entering
> a jail (a jail might run without being used by anybody). In my configuration,
> the line exec.start="/bin/sh /etc/rc" asks to start the services only when the jail is
> created and they will not start again if I exit from the jail and enter again into it
> without destroying and recreating the jail.
> 
> Now, I think you could be in one of the following situations (or maybe both):
> 1) when you start your jail through ezjail, what you are really doing is entering
> in an already created jail and hence services are not started; in that case, it might be
> that ntpd starts regularly if you reboot your system or restart the ezjail service (I think
> it is a service);
> 2) ezjail creates your jail at boot before everything needed by ntpd is set properly, so
> ntpd fails at start and when you enter into the jail there is no ntpd: you could
> check if that is the case by reading into the logs. In that case the solution would be to
> reorder the host's services.
> 
> I hope it helps.

In ezjail terms:
_ you "ezjail-admin create" a jail, meaning the filesystem is set up, 
files copied, binaries installed, etc...; you do this once, but the jail 
is still not running.
_ you "ezjail-admin start" a jail, meaning you actually start whatever 
process should run inside that jail (this is what you mean by "creating 
a jail"?); /usr/local/etc/rc.d/ezjail will do this at boot if you want;
_ you can enter a jail with "ezjail-admin console", in that case a shell 
process is launched inside the jail; when you exit it, the other 
processes in the jail will still be running.

When you "ezjail-admin start" a jail, rc scripts run to start all the 
deamons that should run inside it. ntpd should be no exception.
In my case ntpd is not starting while all other deamons start correctly, 
so I suspect someshing weird is happening with rc scripts.
In this case it's ntpd, but could it possibly happen with other daemons?

  bye & Thanks
	av.


More information about the freebsd-questions mailing list