NTP update after imaging...

Not applicable

Hello All.

Using casper 7.3.1 and imaging machines to 10.6.4.

Today I ran into a batch of laptops that failed to bind to Active Directory during their post-imaging setup. I think I narrowed it down to a time difference, which has happened before. The laptops, fresh from Apple and never booted, were off by around 8 minutes after imaging took place.

I do have a script which sets the NTP server to our main AD domain controller, but it doesn't seem to actually do a time update. To set the time Server I use:
systemsetup -setNetworkTimeServer dc1 -setUsingNetworkTime on

It didn't seem to update through at least one restart. It did happen fine when I went into the time settings.

Is there something that I could add to the script that would force the update to actually happen? it looks like ntpdate or ntpd -q? Anyone have any experience doing this?

Thanks!
Aaron

8 REPLIES 8

ernstcs
Contributor III

doing:

ntpdate <server>

Should do an update. Helpful for when going back to Mac from bootcamp, if
you're not changing how Windows uses UTC.

Hopefully the socket isn't open already. =)

Craig E

jmclaughlin
New Contributor

I've actually been experiencing the same problems with all our white
MacBook orders. It seems that everything is off by 6+ minutes. I've even
emailed Apple and gotten nothing back. Regardless, I've tried doing an
ntpdate just before binding my machines to AD but I couldn't manage to
open the socket connection in time. I'd also be very happy if someone
else took care of this one.

John McLaughlin
Technical Support Specialist
Newton Public Schools

CasperSally
Valued Contributor II

We also used a simple script in past years, but it wasn't working this year (10.6)
We modified our script (below) and so far the issue hasn't reappeared .. we actually print the current time to log file before binding because the issue was pretty widespread as a troubleshooting step - you probably don't need that

#set date, time asap

TIMEZONE="America/New_York"

TIMESERVER="timeserver"

SetDateAndTime () {

systemsetup -settimezone "$TIMEZONE"

systemsetup -setusingnetworktime off

#backing up old NTP config

mv /private/etc/ntp.conf /private/etc/ntp.conf.date +%Y-%m-%d_%H.%M.%S

echo "server $TIMESERVER" > /private/etc/ntp.conf

systemsetup -setusingnetworktime on

sleep 5 #let the clock change before running date

date > /Library/Logs/CurrentTimeBeforeBind.log

}

SetDateAndTime

jarednichols
Honored Contributor

For what it's worth, we've never had NTP/clock skew issues with our images in 10.5 or 10.6.

j
--
Jared F. Nichols
Desktop Engineer, Client Services
Information Services Department
MIT Lincoln Laboratory
244 Wood Street
Lexington, Massachusetts 02420
781.981.5436

Not applicable

Interesting. How are you doing the source image? Have the machines been booted before?

The only time that I get it is when I take a machine out of the box, never having booted or plugged into the network, and image it. My netrestore image is a "clean" os image which has never been booted. After imaging it boots, gets accounts added, ARD and SSH configured - all through post image scripts.

jarednichols
Honored Contributor

We unbox and re-image directly. Our image uses the 10.6 RTM disc as the base and then applies the latest combo update straightaway. Our base OS package (the priority 1 package) is run like an install, not like a laydown of an initially setup machine. It's all fresh install. NTP assignment and timezone setting actually happens upon the reboot after imaging with a script that runs networksetup for those.

j
--
Jared F. Nichols
Desktop Engineer, Client Services
Information Services Department
MIT Lincoln Laboratory
244 Wood Street
Lexington, Massachusetts 02420
781.981.5436

tlarkin
Honored Contributor

in my post image script I use this line and it works for us 100%

/usr/sbin/systemsetup -setnetworktimeserver mytimserver.com

Though I just input the IP address of the NTP server because it is one that doesn't use DNS currently here

Not applicable

John

Processes I have used

Use an rc.local file
This file have to be written out into the /etc directory and have executable permissions, also ensure it is written out with root:wheel ownership.
You could put the rc.local into a package and deploy as part of the system

The code below has the dashes to indicate where word wrap could occur