jails nginx service does not start when starting jail.

In the jail i have :

rc.conf
Code:
syslogd_enable="NO"
nginx_enable="YES"
sendmail_enable="NO"    # Run the sendmail inbound daemon
sendmail_cert_create="NO"    # Create a server certificate if none 
sendmail_submit_enable="NO"    # Start a localhost-only MTA for mail submission
sendmail_outbound_enable="NO"    # Dequeue stuck mail
sendmail_msp_queue_enable="NO"    # Dequeue stuck clientmqueue mail
openssh_enable="NO"

rc.local
Code:
/usr/sbin/service nginx onestart

When i start the jail the service nginx does not start.
But when i log into the jail i can start the service nginx fine.

Any hints on what is wrong ?
This is
/etc/jail.conf:
Code:
path = "/jails/$name";
host.hostname = "$name";
exec.start = "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown";
exec.clean;
persist;
ip4 = inherit;
ip6 = inherit;
mount.devfs;
mount.fdescfs;
allow.mount;
allow.mount.devfs;
allow.mount.fdescfs;
allow.mount.nullfs;
allow.mount.tmpfs;
allow.mount.procfs;
allow.mount.zfs;
enforce_statfs=1;
children.max=100;
allow.socket_af;
allow.raw_sockets;
allow.chflags;
allow.sysvipc;
a {
devfs_ruleset="20";
}
 
Unfortunately, I am facing the same problem and have no solution. What I think is going on is that networking is not available at the moment the nginx service inside the jail is being started.

When I restart a jail, the service is not started because it cannot bind to the IP.

As a sort of workaround I have added the jail IP aliases to /etc/rc.conf.
This way I avoid manual starting of the service inside the jails after reboot.
 
Problem seem to be related to IPv6 in jail.

For me IPv6 services inside jails now work as expected by setting the value of net.inet6.ip6.dad_count to 0.
sysctl net.inet6.ip6.dad_count=0

References
 
Back
Top