Some questions about DirectoryServices
Some questions about DirectoryServices
- Subject: Some questions about DirectoryServices
- From: Eli Bach <email@hidden>
- Date: Tue, 24 Feb 2009 00:23:11 -0800
1. What is the preferred method to get DirectoryServices to re-read
it's configurations files (in particular, it's LDAP configuration).
Right now, I do a 'killall -TERM DirectoryService', which does the
job, but in a relatively heavyhanded way.
2. Probably as a result of doing 1., accessing DirectoryServices soon
after it is restarted will sometimes cause a dirReference to become
valid. I'm doing more testing to see if it's all the time, or just
sometimes, but after restarting DirectoryServices, at least sometimes
other DS functions will return eDSInvalidReference for a reference
that did work. I have a single function that manages a global
dirReference that is used everywhere that one is needed (so
dsOpenDirService() is called once, and that reference is saved for use
by all called to DS.
As a workaround to 2., I've added an extra check, namely a
dsVerifyDirRefNum(), and if it fails, the function sleeps(), then
calls dsOpenDirService() to get a new dirReference.
Is this a reasonable workaround, or is there a better way to restart
DS so the reference doesn't get invalidated?
Or should I assume the dirReference becomes invalid whenever I restart
DS (so I should clear the global value when DS is restarted)?
Or is there a way to wait until DS has completely restarted before
trying to access it?
I'm configuring some ldap settings that the dsconfigldap cli tool
doesn't support, which is why I need to get DS to reload the ldap
configuration.
And yes, I've noticed that it will reset some seemingly unrelated
things, such as using teleportd to share a keyboard/mouse to another
computer (so the keyboard/mouse go back to controlling their host,
instead of the shared computer).
Or is there a better list to ask these questions?
Thanks,
Eli
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden