-
Notifications
You must be signed in to change notification settings - Fork 1
Switch ntpd to systemd-timesyncd #589
Merged
+66
−0
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
6 changes: 6 additions & 0 deletions
6
etc/systemd/system/systemd-timesyncd.service.d/not-on-wtf.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.