Chrony Integration
TimeNow can feed solar time offsets to chrony as an SHM reference clock, allowing you to monitor the deviation between civil (UTC) and local solar time through standard NTP tooling.
How It Works
The TimeNow daemon writes solar offset data to /dev/shm/timenow in a format compatible with chrony's SHM refclock driver. This lets chrony treat the solar offset as an informational reference clock (stratum 10) alongside real NTP sources.
timenow-daemon ──► /dev/shm/timenow ──► chrony (SHM refclock)
│
chronyc sources
│
SOLR #0 ... +1054s
SHM File Format (C Daemon)
The C daemon writes the following key-value pairs to /dev/shm/timenow:
| Field | Description |
|---|---|
offset | Solar offset from UTC in seconds |
clock_sec | Unix timestamp (seconds) |
clock_nsec | Nanoseconds within the second |
precision | Log₂ precision estimate |
leap | Leap second indicator (0 = normal) |
Rust Daemon
The Rust daemon writes a simplified offset value to /dev/shm/timenow_rs. For full chrony SHM integration, use the C daemon.
Setup
1. Install and Run the Daemon
Or run manually:
2. Configure Chrony
Add the following to /etc/chrony.conf:
Note
Stratum 10 ensures chrony will never prefer the solar reference over real NTP servers. This is purely informational — it tracks the deviation between civil and solar time.
3. Restart Chrony
4. Verify
Expected Output
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* ntp.ubuntu.com 2 6 377 34 +0.234ms[+0.198ms] +/- 45ms
^- time.cloudflare.com 3 6 377 35 -1.023ms[-1.058ms] +/- 52ms
#? SOLR 10 4 377 1 +1054s[+1054s] +/- 100ms
The SOLR line shows the current deviation between UTC and local solar time. A positive offset means solar noon has not yet occurred; a negative offset means it has passed.
Use Cases
- Monitor civil/solar deviation — Track how far ahead or behind local solar time is from your clock throughout the day.
- Log solar offset alongside NTP statistics — Correlate solar position with network time data for research.
- Scientific research — Study timekeeping, circadian rhythms, or historical time standards.
- Observatory automation — Integrate solar position awareness into telescope scheduling systems.
Troubleshooting
SOLR source shows ? reach
The daemon may not be running or the SHM file is not being written:
Offset value seems wrong
Verify your latitude and longitude are correct. The solar offset depends on your position within your timezone — locations at the eastern edge of a timezone will have a smaller offset than those at the western edge.