forked from ports/contrib
ntp: Added ntp.conf and ntpd
This commit is contained in:
parent
7ec312d1cc
commit
2b9244f742
@ -7,7 +7,7 @@
|
||||
|
||||
name=ntp
|
||||
version=4.2.2p4
|
||||
release=2
|
||||
release=3
|
||||
source=(http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/$name-$version.tar.gz
|
||||
ntpd
|
||||
ntp.conf)
|
||||
|
66
ntp/ntp.conf
Normal file
66
ntp/ntp.conf
Normal file
@ -0,0 +1,66 @@
|
||||
#
|
||||
# /etc/ntp/ntp.conf: ntp configuration
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
# Default paths
|
||||
|
||||
logfile /var/log/ntp.log
|
||||
pidfile /var/run/ntp/ntpd.pid
|
||||
driftfile /var/lib/ntp/ntp.drift
|
||||
#statsdir /var/lib/ntp/stats/
|
||||
|
||||
###############################################################################
|
||||
# Authentication stuff
|
||||
#
|
||||
# keys /etc/ntp/ntp.keys # path for keys file
|
||||
# trustedkey 1 2 3 4 5 6 14 15 # define trusted keys
|
||||
# requestkey 15 # key (7) for accessing server variables
|
||||
# controlkey 15 # key (6) for accessing server variables
|
||||
|
||||
###############################################################################
|
||||
# Undisciplined Local Clock. This is a fake driver intended for backup
|
||||
# and when no outside source of synchronized time is available.
|
||||
|
||||
server 127.127.1.0 # local clock (LCL)
|
||||
fudge 127.127.1.0 stratum 10 # LCL is unsynchronized
|
||||
|
||||
|
||||
## Generic DCF77 clock on serial port (Conrad DCF77)
|
||||
## Address: 127.127.8.u
|
||||
## Serial Port: /dev/refclock-u
|
||||
## Sample project: http://www.obbl-net.de/dcf77.html by Martin Opel
|
||||
##
|
||||
## u = Number of your serial port
|
||||
##
|
||||
## (create soft link /dev/refclock-0 to the particular ttyS?)
|
||||
##
|
||||
# server 127.127.8.0 mode 5 prefer
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Specify the servers you are interested in
|
||||
|
||||
server ntps1-0.cs.tu-berlin.de prefer
|
||||
server ntps1-1.cs.tu-berlin.de
|
||||
server ntp1.ptb.de
|
||||
server ntp1.fau.de
|
||||
|
||||
###############################################################################
|
||||
# Then we restrict the type of access you allow these servers.
|
||||
# Were not allowing them to modify or query our Linux NTP server
|
||||
|
||||
restrict default ignore notrust nomodify notrap
|
||||
restrict 127.0.0.1
|
||||
#restrict <YOUR_IP_HERE>
|
||||
restrict ntps1-0.cs.tu-berlin.de mask 255.255.255.255 nomodify notrap noquery
|
||||
restrict ntps1-1.cs.tu-berlin.de mask 255.255.255.255 nomodify notrap noquery
|
||||
restrict ntp1.ptb.de mask 255.255.255.255 nomodify notrap noquery
|
||||
restrict ntp1.fau.de mask 255.255.255.255 nomodify notrap noquery
|
||||
|
||||
# Now list the NTP clients on our home network which should be able to query
|
||||
# our server for the time (notice that the noquery has been removed)
|
||||
|
||||
#restrict 192.168.0.0 mask 255.255.255.0
|
||||
|
||||
# End of file
|
23
ntp/ntpd
Executable file
23
ntp/ntpd
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# /etc/rc.d/ntpd: start/stop ntp daemon
|
||||
#
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
/usr/bin/ntpd -gqx
|
||||
/usr/bin/ntpd
|
||||
;;
|
||||
stop)
|
||||
/sbin/hwclock -w
|
||||
killall -q /usr/bin/ntpd
|
||||
;;
|
||||
restart)
|
||||
$0 stop && sleep 3 && $0 start
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 [start|stop|restart]"
|
||||
;;
|
||||
esac
|
||||
|
||||
# End of file
|
Loading…
x
Reference in New Issue
Block a user