registering a new opendirectory module without restart

I have created an OpenDirectory module based on the template and docs here: https://developer.apple.com/library/archive/releasenotes/NetworkingInternetWeb/RN_OpenDirectory/chapters/chapter-1.xhtml.html

After I copy my module in place and I set my module's configuration (see Configuration APIs section), my module does not get loaded. Currently the way I am able to start/reload it is sending a TERM signal to "opendirectoryd". (Launchctl refuses to stop it.) Then launchd restarts it, and my module gets started fine. Problem is that on some macOS this leads to system inresponsiveness for long time (even minutes).

I have tried HUP signal, odutil reset cache etc, they do not help, my module does not get recognized.

Is there a recommended way how to notify opendirectoryd about a new module?

Repro: My example module can be found here: https://www.dropbox.com/scl/fi/qb8pa100yy56n5hangad0/MyODModule-250527-131702.tar.gz?rlkey=m96vb1rrxc6hml878jn64ybc8&st=h22tl4cy&dl=0

To reproduce the behaviour, uncomment line 12 in register_odmodule.sh: "/usr/bin/killall opendirectoryd", and compile and install the module with "make && sudo make install". And observe that it does not get loaded. Then "killall opendirectoryd", and observe that it got loaded. (To test for loaded or not, you can read on the node it creates with dscl: "dscl /MyExample -list /", or just see that it is not started as a process with "ps").

Thanks for any help in advance!

Answered by DTS Engineer in 843050022
Is there a recommended way how to notify opendirectoryd about a new module?

Not that I’m aware of. In general, if a daemon supports you sending it a signal to effect some change, that’s documented in the daemon’s man page. I see nothing like that in the opendirectoryd man page.

During developer I’ve definitely used the SIGTERM trick but I wouldn’t deploy that to production. Rather, I’d have your installer force a restart.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Is there a recommended way how to notify opendirectoryd about a new module?

Not that I’m aware of. In general, if a daemon supports you sending it a signal to effect some change, that’s documented in the daemon’s man page. I see nothing like that in the opendirectoryd man page.

During developer I’ve definitely used the SIGTERM trick but I wouldn’t deploy that to production. Rather, I’d have your installer force a restart.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

registering a new opendirectory module without restart
 
 
Q