Bug 281012 - ypldap works when invoked with -dv, but not when invoked normally (daemonised)
Summary: ypldap works when invoked with -dv, but not when invoked normally (daemonised)
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 14.1-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-23 17:21 UTC by Norman Gray
Modified: 2024-09-06 18:05 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Norman Gray 2024-08-23 17:21:13 UTC
I can configure ypldap.conf in the fairly obvious way, so that ypldap -dv works, in the sense that I can do expected NIS lookups against it, manifestly getting data from my LDAP server, and I see all sorts of reassuring chatter as it does its work.  But when I relaunch the server the normal way, so that it daemonises, the same NIS lookups fail, timing out.

ypldap doesn't seem to have extensive debug logs, and the process doesn't crash in an easily debuggable way, so I can't give much extra information.

I'm afraid I'm not able to dig into this very deeply.  I built a version of the program including got-here debugging, and that seemed to get itself into a loop with yp_fd_event being called repeatedly.  But I've no experience with the event library here (and this is not the time for me to take on new projects!), so I lack capacity to make much sense of what I'm seeing.  Nothing, at any rate, jumps out when I do this.

A separate odd thing, which I mention because it may or may not be related, is that the /etc/rc.d/ypldap script includes

ypldap_precmd()
{
        force_depend ypserv nis_server || return 1
}

That _seems_ to include a dependency on ypserv, but as the ypldap(8) manpage very intelligibly notes, 'ypldap has the same role as ypserv(8) and the two daemons are exclusive.' So I wonder if there's something else funny going on here.

I note that ypldap has (unsurprisingly) seen very little real development work in the last few years, and probably also rather little actual use, so I'm guessing a change in one or other base version has broken something here.  But that might have been a while ago, since the only online commentary I can find is at [1], from 2016, which seems to be reporting similar behaviour.


[1] https://groups.google.com/g/muc.lists.freebsd.stable/c/nO0NMaSbD7o
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2024-09-06 18:05:02 UTC
Indeed, ypldap appears to be mostly unmaintained these days.  It would be nice to sync it back up with OpenBSD but one needs a suitable testing environment set up.

My one suggestion for narrowing down the problem would be to collect a system call trace from the daemonized ypldap, by starting it with "ktrace -f /tmp/ktrace.out -i ypldap ...", or by adding ypldap_prepend="ktrace -f /tmp/ktrace.out -i" to /etc/rc.conf if you're starting it that way.

Once ypldap exits, run "kdump -f /tmp/ktrace.out" and share the output here.