The ctld service does not wait for sysctl.conf to be evaluated before running.
Unfortunately, the drivers for some popular cards require sysctl configuration in sysctl.conf (not possible in loader.conf) to bring them up in the correct mode (e.g. mlx4/mlx4en to set the card in ip instead of ib mode), meaning that when ctld starts up, it fails immediately because it can't listen on the requested address.
I'm unsure how to modify /etc/rc.d/ctld to enact a dependency on sysctl.conf's evaluation; for my purposes I ended up hacking the ctld service itself to unconditionally execute the sysctls I need set prior to actually processing the service start command.
Created attachment 221173 [details]
Add dependancy on NETWORKING
If the ctl.conf specifies an IP address then ctld won't start. Adding a requirement on NETWORKING will solve my issue, and your example. What other sysctl's were you using?
NETWORKING requires netif which requires sysctl
Yup. This should do the trick.
I just hit this as well, not because of sysctl.conf, but because of specifying an IP address in ctld.conf. Can we get the dependency on NETWORKING include din time for 13 ?
Am guessing not, given the timing, but even just getting this fixed in current & stable would be nice...
BTW, having the bug as "affects only me" is a bit of a mischaracterisation, as this will affect anyone who only wants ctld to listen on a specific IP address wont it ?
(In reply to Pete French from comment #5)
[Speaking for myself here, not as bugmeister@]
I will repeat my usual claim that the "Affects" setting is ... ah ... merely decorative.
In an organization that has paid employees who can be told "prioritze PRs based on the following criteria", such things mean something.
But we aren't such an organization. I have never heard of any bug triagers that use that field to look for PRs.
If I were some kind of ruthless dictator I'd just turn it off :-)
A commit in branch main references this bug:
Author: Edward Tomasz Napierala <trasz@FreeBSD.org>
AuthorDate: 2021-04-05 15:40:49 +0000
Commit: Edward Tomasz Napierala <trasz@FreeBSD.org>
CommitDate: 2021-04-05 15:40:54 +0000
rc: make ctld depend on NETWORKING
This fixes a problem where ctld(8) would refuse to start on boot
with a specific IP address to listen on configured in ctl.conf(5).
It also fixes a problem where ctld(8) would fail to start with
some network interfaces which require a sysctl.conf(5) tweak
to configure them, eg to switch them from InfiniBand to IP mode.
Reported By: Mahmoud Al-Qudsi <mqudsi at neosmart.net>
Submitted By: Jeremy Faulkner <gldisater at gmail.com>
Reviewed By: mav
Differential Revision: https://reviews.freebsd.org/D29578
libexec/rc/rc.d/ctld | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)