Skip to content

Commit

Permalink
Merge pull request #148 from dappnode/diego/disable-systemd-timesyncd
Browse files Browse the repository at this point in the history
Disable timesyncd in any case
  • Loading branch information
pablomendezroyo authored Sep 18, 2023
2 parents 6558d81 + 56f084a commit 381cfe5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/scripts/enable_chrony.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ if apt-get install -y chrony; then
echo "Chrony installed successfully."

# Check if systemd-timesyncd is active and disable it (should have been done by the chrony package install)
if systemctl is-active --quiet systemd-timesyncd; then
echo "Stopping and disabling systemd-timesyncd..."
systemctl stop systemd-timesyncd
systemctl disable systemd-timesyncd
fi
echo "Stopping and disabling systemd-timesyncd..."
systemctl stop systemd-timesyncd
systemctl disable systemd-timesyncd

# Check if chrony is already syncing properly
if ! chronyc tracking | grep -q "Leap status\s\+:\s\+Normal"; then
Expand All @@ -40,4 +38,5 @@ fi

# Set system clock to UTC. Maintaining the RTC in the local timezone is not fully supported and will create various problems
# with time zone changes and daylight saving adjustments. Reference: https://manpages.debian.org/unstable/systemd/timedatectl.1.en.html
echo "Setting system clock to UTC..."
timedatectl set-local-rtc 0

0 comments on commit 381cfe5

Please sign in to comment.