Difference between revisions of "User:Alexmat/Network Time Protocol Daemon"

From ArchWiki
Jump to: navigation, search
(No difference)

Revision as of 00:57, 18 September 2005

Network Time Protocol Daemon Setup

Install

pacman -Sy ntp

Configure

# default restrictions
restrict default noquery notrust nomodify

# override the default restrictions
restrict 192.168.1.0 mask 255.255.255.0 nomodify

# public NTP servers to sync with
server bigben.cac.washington.edu
server time-nw.nist.gov
server tick.ucla.edu

restrict bigben.cac.washington.edu noquery nomodify
restrict time-nw.nist.gov noquery nomodify
restrict tick.ucla.edu noquery nomodify

# NTP drift file
driftfile /etc/ntp.drift

# NTP log file
logfile /var/log/ntp.log

Prevent DHCP Overwrite of /etc/ntp.conf

Edit /etc/conf.d/dhcpcd:

DHCPCD_ARGS="-t 30 -h $HOSTNAME -N"

Sync Time with Stratum 1 Server on Boot

Edit /etc/rc.d/ntpsync:

. /etc/rc.conf
. /etc/rc.d/functions

# Sync with Stratum 1 time server
stat_busy "Syncing System Clock"
/usr/bin/ntpdate -s bigben.cac.washington.edu
stat_done

Set executable:

chmod +x /etc/rc.d/ntpsync

Add NTPD to Daemon Startup List

Edit /etc/rc.conf:

Daemons(... ntpsync ntpd ...)