Skip to main content

Time sync diagnostics

v0.1.13

Clock-sync state for a Linux host on either time daemon: Chrony tracking and sources, the NTPsec peer table, current time, drift estimate, timezone, plus fix actions (chronyc makestep, enable/disable NTP). Use when a host's clock is drifting (a common cause of TLS / auth / log-correlation bugs).

5 allowed by default 2 need approval by default
Pack ID
time-sync
Vendor
emisar
OS
linux
Actions
7
Required binaries. Install these on the host before relying on the pack — an action that calls a missing one fails at run time.
chronyc ntpq timedatectl

Install

emisar pack install fetches this pack, re-validates it, and verifies its content hash against the --hash below — the exact bytes this page was rendered against, so a tampered copy is rejected — before copying it into the runner's packs dir. The command reloads a running daemon itself; no manual restart.

on the runner host
sudo emisar pack install time-sync --hash sha256:eafb3471f395285700626aa1da296884effabea013ffd8a3629b8c974f12a89c

Setup

Queries and adjusts Chrony, NTPsec, and systemd time state on the local runner host — no credentials needed.

Host access

Run these commands yourself on the runner host. Emisar shows and copies setup recipes; it never runs them.

Step the system clock or change the host NTP setting as root.

time.chronyc_makesteptime.timedatectl_set_ntp

Run the Emisar service as root

Grant access
sudo install -d -m 0755 /etc/systemd/system/emisar.service.d
printf '%s\n' '[Service]' 'User=root' 'Group=root' | sudo tee /etc/systemd/system/emisar.service.d/10-time-sync-host-access.conf >/dev/null
sudo systemctl daemon-reload
sudo systemctl restart emisar
Verify access
test "$(systemctl show emisar --property=User --value)" = root

Impact: Every Emisar action on this runner executes as root. These actions can abruptly step wall-clock time or change which daemon controls synchronization.

Notes

  • Read actions (timedatectl, chronyc tracking/sources, ntpq peers, date) need no privileges.
  • A host runs one time daemon, so the actions for the other one fail with a missing binary: the chronyc actions need Chrony, and time.ntpq_peers needs NTPsec/ntpd. timedatectl and date answer on either.

Verify it works

Runs time.timedatectl, a low-risk read that confirms the pack can reach its target. Run it on the host once the pack is installed; pack install runs it for you.

on the runner host
sudo emisar pack verify time-sync

Install and configure a pack walks through the whole sequence on a host.

Actions 7 total

View on GitHub
  • time.chrony_sources exec low Low — read-only or trivially reversible

    chronyc sources -v

    List NTP sources + reach + stratum + offset.

    View source on GitHub
  • time.chrony_tracking exec low Low — read-only or trivially reversible

    chronyc tracking

    Show Chrony's view of clock drift, frequency, last update.

    View source on GitHub
  • time.chronyc_makestep exec high High — service-affecting

    chronyc makestep

    Force chrony to step the system clock NOW instead of slewing. Use when drift exceeds slew tolerance and applications can't wait. Jumps in time can confuse cert validation, log timestamps, and event ordering.

    View source on GitHub
  • time.date_now exec low Low — read-only or trivially reversible

    date -u

    Show UTC + local time + day-of-week. Compare against the requester's clock to spot drift.

    View source on GitHub
  • time.ntpq_peers exec low Low — read-only or trivially reversible

    ntpq -pn

    List the NTPsec peer table with numeric addresses.

    View source on GitHub
  • time.timedatectl exec low Low — read-only or trivially reversible

    timedatectl status

    Show current time, timezone, NTP-active state, RTC sync state.

    View source on GitHub
  • time.timedatectl_set_ntp exec high High — service-affecting

    timedatectl set-ntp <bool>

    Enable or disable NTP synchronization. Disabling is rare — primarily for offline testing.

    View source on GitHub