- This topic has 7 replies, 5 voices, and was last updated 16 years, 1 month ago by
knowmad.
-
AuthorPosts
-
February 24, 2009 at 6:26 pm #375540
userosx
ParticipantI have no problems binding to Active Directory (or even OD). However, I am having one minor, yet very tedious issue.
I’ve decided to use launchd (scripts) to both rename the computers, and bind them to AD. It’s easy to package LaunchDaemons, and it seems to be the preferred method. We have a local script that automatically renames the computer based on the MAC address (first boot). And we have another script to bind them to the domain. So, I can package the “rename” daemon and the “joindomain” daemon and tell them both to run at startup, but the problem is that sometimes it will bind before it is actually renamed. In other words, there doesn’t appear to be a way to tell them in what order to launch (via launchd). Both functions work, I just can’t seem to get it to reliably rename the computer before it tries to join the domain.
I can’t do this as a loginhook, because of course that would require someone to login before the computer was renamed. Also, we do not have OD or AD with schema extensions, so I can’t make any changes at the directory level. Anyway, I was just hoping somebody had a better way. Perhaps there is a way to run our “macrename” script during installation…
So I guess the question is, if you use AD, how are you configuring & packaging the functionality that renames and binds the computers to the domain? My current method should work perfectly if I could just tell launchd to run daemon before the other and wait for he first to complete…
February 24, 2009 at 8:56 pm #375544Greg Neagle
ParticipantAny particular reason you can’t just combine both of these actions into a single script?
February 24, 2009 at 9:59 pm #375545userosx
ParticipantBoth scripts are lengthy and written in a different language. However, I suppose I could have the daemon call a script that calls both scripts in succession… That might work… Why did I not think of that before? Well, hopefully it works…
February 25, 2009 at 3:13 am #375551Patrick Fergus
ParticipantWe go as far as having a CustomPKG that installs a StartupItem (deprecated, I know) that installs our first boot pkgs, and a different CustomPKG that drops the pkgs to be installed on first boot and a text file that gives the installation order. Tidy once you wrap your head around it.
We also have a pkg that gets installed first that does nothing but sleep for 60 seconds allow OS X to finish starting up. It helps avoid weirdness with not-fully-started OS services.
– Patrick
February 26, 2009 at 12:59 am #375570knowmad
ParticipantPatrick,
On that last item of starting something to hold things up so everything can boot… someone else (no time to look and my memory is fuzzy) mentioned a neat trick of using launchdaemon to launch a script that looks for the items you need to be loaded before installing…. If it does not see them it exits on 0 which causes launchdaemon to simply relaunch…
lather-rinse-repeat until it sees what it needs, then it launches the installers and exits on 1 which actually lets it die.
The last in your chain of installers removes the script from launch-line-up (so to speak) and your all done.
One time first boot that makes certain not to run until everything is ready.
later I will look up the particulars and post-em.February 26, 2009 at 1:50 am #375571Rusty Myers
ParticipantI solve this issue by only running the computer naming script, then it loads the launchd item for the ad bind script and reboots. Then after reboot, it binds. You could also do an if statement that would check to see if the computer is named correctly.
Rusty
February 27, 2009 at 9:10 pm #375580userosx
Participant[QUOTE][u]Quote by: thespider[/u][p]I solve this issue by only running the computer naming script, then it loads the launchd item for the ad bind script and reboots. Then after reboot, it binds. You could also do an if statement that would check to see if the computer is named correctly.
Rusty[/p][/QUOTE]
I like this idea… If my current method doesn’t work, I’ll have to give this a try. Well, I’m going to find out if my current method works in about an hour. 🙄
February 27, 2009 at 9:18 pm #375581knowmad
Participant[QUOTE][u]Quote by: knowmad[/u][p]…..If it does not see them it exits on 0 which causes launchdaemon to simply relaunch…
lather-rinse-repeat until it sees what it needs, then it launches the installers and exits on 1 which actually lets it die.
[/p][/QUOTE]um, wow I was in a rush, got that backwards… exit on 1 causes respawn, exit on 0 causes clean end.
sorry…. still don’t have time to find the originator of that post/idea. -
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed