Skip to content

chrony: add UCI options for drift file and time restoration - #30799

Open
drizt wants to merge 1 commit into
openwrt:masterfrom
drizt:chrony_driftfile
Open

drizt wants to merge 1 commit into
openwrt:masterfrom
drizt:chrony_driftfile

Conversation

@drizt

@drizt drizt commented Oct 17, 2026 •

Copy link
Copy Markdown

chronyd can restore the system time at startup from the drift file's modification time. This helps routers without a real-time clock recover a more recent time after reboot when the drift file is stored on persistent storage.

Add a UCI section to configure the drift file path, its minimum update interval, and optional time restoration using chronyd's -s option. Keep time restoration disabled by default and preserve the existing drift file path for configurations without the new section.

config driftfile 'driftfile'
    # Set to 1 to restore time from the drift file at startup
    option restore_time '0'
    # Use a path on persistent storage to retain the file across reboots
    option file '/var/run/chrony/drift'
    # Minimum update interval in seconds; empty uses chronyd's default
    option interval ''

📦 Package Details

Maintainer: @mlichvar
(You can find this by checking the history of the package Makefile.)

Description:
See commit message


🧪 Run Testing Details

  • OpenWrt Version: 25.12.5 r33051-f5dae5ece4
  • OpenWrt Target/Subtarget: ramips/mt7621
  • OpenWrt Device: ASUS RT-AX53U

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

chronyd can restore the system time at startup from the drift file's
modification time. This helps routers without a real-time clock recover
a more recent time after reboot when the drift file is stored on
persistent storage.

Add a UCI section to configure the drift file path, its minimum update
interval, and optional time restoration using chronyd's -s option.
Keep time restoration disabled by default and preserve the existing
drift file path for configurations without the new section.

```uci
config driftfile 'driftfile'
    # Set to 1 to restore time from the drift file at startup
    option restore_time '0'
    # Use a path on persistent storage to retain the file across reboots
    option file '/var/run/chrony/drift'
    # Minimum update interval in seconds; empty uses chronyd's default
    option interval ''
```

Signed-off-by: Ivan Romanov <drizt72@zoho.eu>
@openwrt

openwrt Bot commented Oct 17, 2026

Copy link
Copy Markdown

Formality Check: Failed

We checked this pull request against the contribution guidelines. Here is what needs your attention:

🛑 CRITICAL ERRORS

Commit 429bef3 - chrony: add UCI options for drift file and time restoration:

  • File 'net/chrony/files/chrony.conf' is destined for '/etc/config/' but is not a valid UCI configuration file. In OpenWrt, '/etc/config/' is reserved for UCI-formatted configuration files. Raw files (such as TOML, JSON, or YAML) are not allowed at this path. Invalid line 2: 'confdir /var/etc/chrony.d'

Tip

Do not close this pull request to make corrections. Instead, modify your existing commits (e.g. git commit --amend) and update the branch using git push --force-with-lease --force-if-includes. The checks will re-run automatically.


Something broken? Consider reporting an issue.
Running version 37cc78e deployed on 2026-10-15 12:36:36 CEST

@drizt

drizt commented Oct 17, 2026

Copy link
Copy Markdown
Author

File 'net/chrony/files/chrony.conf' is destined for '/etc/config/' but is not a valid UCI configuration file. In OpenWrt, '/etc/config/' is reserved for UCI-formatted configuration files. Raw files (such as TOML, JSON, or YAML) are not allowed at this path. Invalid line 2: 'confdir /var/etc/chrony.d'

It's not mine file. The file from original package. I only removed two lines in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant