puflogh300X74.gif

Polarwave's OpenBSD
Tips and Tricks for Newbies

| NTPD |

| Home | Tips and Tricks | Links | News Feeds | Fun | Contact | Blog (Opens in New Page) |


NTPD Reset Clock at Boot Time

When you enable ntpd in /etc/rc.conf like so

ntpd_flags="-s" # for normal use: ""
if your network interface isn't up, ntpd can hang for a while before the system finishes
booting. Some say they've seen it hang for up to half an hour. Instead of the entry above,
you can use:
if ifconfig fxp0 | grep 'status: active' >/dev/null 2>&1
then
ntpd_flags=-s
else
ntpd_flags=NO
fi

I set ntpd_flags=NO in /etc/rc.conf and then entered the code above in /etc/rc.local
and it works fine. If you've got more than one interface, for instance, maybe you plugged
in your 'wi' PCMCIA card before booting, you can do this:
if ifconfig fxp0 | grep 'status: active' >/dev/null 2>&1 ||
ifconfig wi0 >/dev/null 2>&1
then
ntpd_flags=-s
else
ntpd_flags=NO
fi
That way, if either one's up, ntpd will be able to set the time. If not, the script will set
ntpd_flags to NO and booting will continue.

Back to Tips and Tricks
Home

Delicious Bookmark this on Delicious

No affiliation between this site and the OpenBSD project exists or is implied.

valid-html401.png