r/macsysadmin • u/magnusthewize • 14h ago
MacOS SystemConfiguration: Can you guarantee a network operation has finished after a process crash?
I'm developing a macOS network failover controller and looking for advice from developers experienced with SystemConfiguration, networksetup, or configd.
The controller changes network service priority using:
networksetup -ordernetworkservices
I'm also investigating the equivalent native approach using:
SCNetworkSetSetServiceOrderSCPreferencesCommitChangesSCPreferencesApplyChanges
The problem
If the process performing the network change hangs, times out, or crashes, how can I reliably determine whether macOS has finished processing that operation?
For example:
- The controller requests a network service-order change.
- The command hangs or the controlling process crashes.
- macOS may already have accepted the configuration change.
- A replacement controller starts.
At this point, I don't know whether the previous operation could still affect the network.
I want to avoid issuing another network-changing command while the original operation might still be in progress.
What I've investigated
I've looked at SystemConfiguration preference locks, commit/apply calls, callbacks, notifications, and process termination.
So far, I haven't found a documented mechanism that guarantees all downstream network effects have completed.
My current design uses a single operation authority and a persistent journal. If an operation's outcome becomes uncertain, the controller blocks additional changes rather than attempting an automatic rollback.
My questions
- Does a successful
SCPreferencesApplyChangescall guarantee that the relevant downstream configuration work has finished? - Can configuration work submitted to
configdcontinue after the original process terminates? - Is there an operation-specific completion acknowledgement or synchronization mechanism I've overlooked?
- Is there a supported way to reconcile an interrupted operation before issuing another change?
I'm targeting macOS Sequoia on an Intel Mac mini.
I'm particularly interested in documented API guarantees, relevant Apple documentation, or firsthand experience with this failure scenario.
I don't need a general failover implementation. I'm specifically trying to establish a defensible completion or cancellation boundary.
Any insights would be appreciated.
