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: URL: https://cgit.FreeBSD.org/src/commit/?id=015351de04e3e621cff825cc1fdad5faf078c3ac commit 015351de04e3e621cff825cc1fdad5faf078c3ac 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. PR: 232397 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(-)
tripped up by this again today... could we get the patch MFC'd into 12 maybe ?
13 too
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=c0163f4abef029cd5ed6db9357665ae29a86716d commit c0163f4abef029cd5ed6db9357665ae29a86716d Author: Edward Tomasz Napierala <trasz@FreeBSD.org> AuthorDate: 2021-04-05 15:40:49 +0000 Commit: Andriy Gapon <avg@FreeBSD.org> CommitDate: 2022-01-21 07:45:20 +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. PR: 232397 (cherry picked from commit 015351de04e3e621cff825cc1fdad5faf078c3ac) libexec/rc/rc.d/ctld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=e265658e4e36c779c5c33bd9c25dd620eb83b886 commit e265658e4e36c779c5c33bd9c25dd620eb83b886 Author: Edward Tomasz Napierala <trasz@FreeBSD.org> AuthorDate: 2021-04-05 15:40:49 +0000 Commit: Andriy Gapon <avg@FreeBSD.org> CommitDate: 2022-01-21 07:46:42 +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. PR: 232397 Reported By: Mahmoud Al-Qudsi <mqudsi at neosmart.net> Submitted By: Jeremy Faulkner <gldisater at gmail.com> (cherry picked from commit 015351de04e3e621cff825cc1fdad5faf078c3ac) libexec/rc/rc.d/ctld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
*** Bug 254432 has been marked as a duplicate of this bug. ***
With 12.2 going EOL, there are likely to be another wave of updaters; it would be nice to get this simple fix into 13.0-pX. Lead to some mild panic these evening for myself. (I knew I could always go back thanks to boot environments, so only mild. ;)
(In reply to eborisch+FreeBSD from comment #13) <https://github.com/freebsd/freebsd-src/commit/c0163f4abef029cd5ed6db9357665ae29a86716d> is in both stable/13 and releng/13.1