-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Use timesyncd with recovery clock file
Replaced ntpd with sytemd timesyncd. This allows to use a recovery clock file to have a more accurate system time during boot up. This greatly helps with log file timestamps. Otherwise they always start in 2019 and journal logs get all messed up until time synchronization is available. The recovery clock file is updated 2min after boot up, thereafter every 5 minutes and before shutdown. Whenever timesyncd receives a time update the file is updated as well internally by timesyncd. More information: https://wiki.archlinux.org/index.php/Systemd-timesyncd
- Loading branch information
Showing
8 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
overlay/etc/systemd/system/multi-user.target.wants/shutdown-clock-file.service
This file contains 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 @@ | ||
../shutdown-clock-file.service |
1 change: 1 addition & 0 deletions
1
overlay/etc/systemd/system/multi-user.target.wants/update-clock-file.timer
This file contains 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 @@ | ||
../update-clock-file.timer |
This file contains 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,11 @@ | ||
[Unit] | ||
Description=Final clock file update before shutdown | ||
RequiresMountsFor=/ | ||
|
||
[Service] | ||
ExecStop=/etc/update_clock_file.sh | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains 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,9 @@ | ||
|
||
[Unit] | ||
Description=Run clock file update script | ||
RefuseManualStart=no | ||
RefuseManualStop=no | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/etc/update_clock_file.sh |
This file contains 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,9 @@ | ||
[Unit] | ||
Description=Clock file update timer | ||
|
||
[Timer] | ||
OnBootSec=120 | ||
OnUnitActiveSec=300 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains 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,2 @@ | ||
#! /usr/bin/env sh | ||
touch /var/lib/systemd/timesync/clock |
This file contains 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
This file contains 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