send_nsca fails to connect when run via cron or LaunchAgent on macOS 15 (Tahoe), but works manually in Terminal
I’m running macOS 15 (“Tahoe”) and have an issue where a command-line program (send_nsca, part of Nagios) can successfully connect to a remote host when executed manually in Terminal, but fails with Connection refused or timed out when executed automatically (via cron or a LaunchAgent).
I’ve verified the following:
- The same command, same user, and same configuration file work perfectly when run in Terminal.
- Network access is available from the background context:
- ping, nc, and curl to the target host/port succeed when executed from the LaunchAgent script.
- The macOS firewall (socketfilterfw) is configured to allow both /usr/sbin/cron and /usr/local/nagios/bin/send_nsca.
- No relevant entries appear in the system logs for tccd, sandboxd, or send_nsca (no “deny network-client” or similar).
Yet, send_nsca consistently fails when executed in the background (both from cron and LaunchAgent), even though basic network tests in the same context succeed.
What I’ve tried:
- Granting full disk access to cron, launchd, and send_nsca.
- Disabling and re-enabling the macOS firewall.
- Using an explicit PATH and DYLD_LIBRARY_PATH in the script and LaunchAgent plist.
- Testing with both IPv4 and IPv6 (IPv4 works fine manually).
Symptoms in tcpdump:
- When run manually: normal TCP handshake → data exchange → clean FIN/ACK close.
- When run from cron or LaunchAgent: SYN packets are sent, but the connection immediately closes with FIN/RST.
Environment:
- macOS 15 “Tahoe”
- send_nsca (Nagios client binary, compiled locally)
Question:
Has anyone seen a case on macOS 14/15 where a background process (cron, launchd, LaunchAgent) loses permission or ability to open outbound TCP sockets, even though the same binary works interactively in Terminal ?
Could this be related to TCC, sandboxing, or some hidden network entitlement restriction in the new macOS versions ?
Mac Studio (M4 Max, 2025)