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


pacman -Sy ntp


# default restrictions
restrict default noquery notrust nomodify

# override the default restrictions
restrict mask 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:


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

Set executable:

chmod +x /etc/rc.d/ntpsync

Add NTPD to Daemon Startup List

Edit /etc/rc.conf:

Daemons(... ntpsync ntpd ...)