Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!


Click here to return to the '10.4: Automatic time resync after Boot Camp usage' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
10.4: Automatic time resync after Boot Camp usage
Authored by: BC_ME on Tue, May 8 2007 at 6:34PM PDT
We have seen a similar issue in our machines, the only issue is that in an AD environment you need the time to sync before login. To combat this, we added (or edited, if one already exists) the rc.local file in /etc with the following bash script that kills ntpd, tries up to 5 times to see if a timeserver can be contacted and then restarts network time to resync the time. This seems to work ok. It probably could be cleaner but it works for us.

#!/bin/bash

killall ntpd

/usr/sbin/ntpdate
RETVAL=$?
TRIES=1
sleep 1
until [[ "$RETVAL" == "0" || "$TRIES" == "5" ]]; do
/usr/sbin/ntpdate
RETVAL=$?
sleep 1
TRIES=`expr $TRIES + 1`
done;

. /System/Library/StartupItems/NetworkTime/NetworkTime start


[ Reply to This | # ]