Hello Yuri,

I recently found that it is strictly related to  exec.fib=1 and renamed the 
topic to "network not ready (?) while jail rc.startup when fib not 0". May be 
it was incorrect action I don't know does anybody see it.
I copy it here:

The issue is related to jail parameter

   exec.fib = 1;

When it is not set the issue disappeared. When fib is 1 the previously 
mentioned problem arises.
It seems to be something related to kernel:

" This is a timing race condition directly tied to how FreeBSD initializes 
independent routing tables (FIBs) for shared-IP jails.
When exec.fib=1 is configured, the jail executes all its internal /etc/rc boot 
processes within FIB 1. However, during the early stage of the jail creation 
sequence, the host assigns the jail's shared IP alias to FIB 0 first before the 
exec.fib=1 routine fully maps the IP alias space into FIB 1."

Tuesday, October 13, 2026, 7:16:11 PM, you wrote:


A restart fixing it, suggests some persistent state or some other dep. Could 
you collect additional information?
1. Temp enable the debug log of nslcd.conf inside the jail
2. While it is broken, try to look up for a known ldap user: "getent passwd 
<ldap_user>". Repeat after 30 secs w/o restarting.
3. If the log only reports a generic connection error, trace the existing 
broken process. Run as root on the host, substituting that jail's nslcd pid:
   ktrace -t cs -f /tmp/nslcd-failed.ktrace -p PID
Trigger the lookup inside the jail, then on the host:
   ktrace -c -p PID
   kdump -f /tmp/nslcd-failed.ktrace > /tmp/nslcd-failed.txt

The useful sequence is socket(), connect(), any getsockopt(SO_ERROR), and 
subsequent operations on that descriptor. EINPROGRESS from a non-blocking 
connect() is normal; the eventual result matters. A successful TCP connection 
followed by LDAP failure points toward TLS, binding, or connection handling 
instead of an outbound socket restriction.

or you can share the collected files.
-- 

On Tue, Oct 13, 2026 at 6:04 AM Anthony Pankov <[email protected]> wrote:

Hello,

I have an issue with nss-pam-ldapd (nslcd) inside a jail.
When the jail started nslcd do not work and say "Can't connect LDAP server".
After "service nslcd restart" all work as expected.

May be somebody can explain/help?


I have many tries myself, then with AI and no luck. Before AI give up it said:
"The Socket is not connected error happens when nslcd handles an early request 
inside the jail while dropping root privileges (setuid). In a shared-IP jail 
environment, FreeBSD's kernel enforces a strict network isolation rule: an 
unprivileged process inside a jail is completely forbidden from creating an 
outbound TCP socket (connect()) if it is inside a process path processing a 
local UNIX domain socket loop check."


Jail is configured as:
    # host shared loopback
    ip6.addr += "hosl|1:2554:e::1/64";
    # use casual ip4
    ip4.addr = "$if_lan|192.168.0.113";

P.S.
System is 14-stable.
Things that doesn't help:
- adding ip4.add="lo0|127.1.0.1"
- prevent dropping privileges (uid root, gid wheel in nslcd.conf)
- running with "nscld_supervisior="YES" (through daemon)
- defining IP addresses (host(jail) itself, ldap servers) in /etc/hosts
- preventing any real query to ldap from nslcd before startup sequence end

-- 
Best regards,
 Anthony Pankov                         mailto:[email protected]




-- 
Thanks,
Yuri.


-- 
Best regards,
Anthony


Reply via email to