enable_ntp #153

Merged
narenas merged 4 commits from enable_ntp into main 2026-04-24 17:17:09 +02:00
Collaborator
There is no content yet.
narenas added 4 commits 2026-04-24 17:17:03 +02:00
8846445e07 Add NTP time synchronization at oglive boot
oglive clients (running without systemd) have no automatic time sync,
which causes Filebeat to timestamp logs with incorrect times, making
them invisible in Grafana's time range queries.

Add sync_time() to InitLib.py that runs before filebeat() on every boot:
- Uses ogntp env var as NTP server if set, falls back to ogcore
- Tries ntpdate first, falls back to chronyd one-shot if unavailable
- Logs the result to /tmp/oginit.log for debugging
be502dd0cd Fix sync_time() to handle missing NTP binaries gracefully
If ntpdate or chronyd are not available in the oglive image,
subprocess.run() raises FileNotFoundError which would crash preinit.py
and interrupt the boot sequence. Wrap each call in try/except so a
missing binary is logged and the boot continues normally.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
narenas merged commit ef8389387f into main 2026-04-24 17:17:09 +02:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: opengnsys/ogclone-engine#153
There is no content yet.