Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions etc/ntpd-time.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Note: This is only for time.molgen.mpg.de@wtf

interface ignore wildcard
interface listen 141.14.16.215 # time.molgen.mpg.de
interface listen 127.0.0.1 # for ntpq

server ntps1.gwdg.de iburst
server ntps2.gwdg.de iburst
server ntps3.gwdg.de iburst
server ntps4.gwdg.de iburst
server zeit.fu-berlin.de iburst
server ntps1-0.cs.tu-berlin.de iburst
server ptbtime1.ptb.de iburst
server ptbtime2.ptb.de iburst
server ptbtime3.ptb.de iburst
server 0.de.pool.ntp.org iburst
server 1.de.pool.ntp.org iburst

driftfile /var/cache/ntp.drift

restrict default nomodify noquery notrap nopeer
restrict 127.0.0.1
13 changes: 13 additions & 0 deletions etc/systemd/system/ntp-clock-stamp.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
ConditionHost=wtf.molgen.mpg.de
After=ntpd-time.service
BindsTo=ntpd-time.service

[Service]
Type=exec
ExecStartPre=/usr/bin/mkdir -p /var/lib/systemd/timesync
ExecStart=/bin/bash -c 'while true; do out=$(ntpq -c "rv 0 leap" 2>/dev/null); [[ $out =~ leap=(00|01|10) ]] && touch /var/lib/systemd/timesync/clock; sleep 60; done'
Restart=on-failure

[Install]
WantedBy=multi-user.target
18 changes: 18 additions & 0 deletions etc/systemd/system/ntpd-time.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[Unit]
ConditionHost=wtf.molgen.mpg.de
DefaultDependencies=no
After=systemd-sysusers.service
Before=time-set.target sysinit.target shutdown.target
Conflicts=shutdown.target
Wants=time-set.target

[Service]
ExecStart=/usr/bin/ntpd -n -g -c /etc/ntpd-time.conf
Restart=always

# ntpd logs to syslog, stdout/stderr is redundant
StandardOutput=null
StandardError=null

[Install]
WantedBy=basic.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Don't start systemd-timesyncd on wtf, because on this host we start
# ntpd-time.service which regulates the kernel real time clock.

[Unit]

ConditionHost=!wtf.molgen.mpg.de
7 changes: 7 additions & 0 deletions etc/systemd/timesyncd.conf.d/local.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Time]

# several fallbacks. systemd-timesyncd will use the first responding server and stick
# to it as long as it is reachable or until restarted.
# test remote with `ntpdate -q SERVER` (no change of local time)

NTP=time.molgen.mpg.de ntps1.gwdg.de ntps2.gwdg.de ntps3.gwdg.de ntps4.gwdg.de zeit.fu-berlin.de ntps1-0.cs.tu-berlin.de ptbtime1.ptb.de ptbtime2.ptb.de ptbtime3.ptb.de 0.de.pool.ntp.org 1.de.pool.ntp.org