feat: implement montauk::service_log & add support to system services

This commit is contained in:
2026-08-28 11:56:29 +02:00
parent 0d23db8a0e
commit b1f1cfe32b
8 changed files with 117 additions and 62 deletions
+5 -3
View File
@@ -6,8 +6,10 @@
#include <montauk/config.h>
#include <montauk/ntp.h>
#include <montauk/service_log.h>
#include <montauk/string.h>
#include <montauk/syscall.h>
#include <libc/stdio.h>
static constexpr uint64_t RETRY_INTERVAL_MS =
montauk::ntp::MIN_QUERY_INTERVAL_MS;
@@ -15,9 +17,9 @@ static constexpr uint64_t SYNC_INTERVAL_MS = 60ULL * 60ULL * 1000ULL;
static constexpr uint64_t CONFIG_POLL_MS = 5000;
static void log(const char* message) {
montauk::print("ntp: ");
montauk::print(message);
montauk::print("\n");
char line[256];
snprintf(line, sizeof(line), "ntp: %s", message);
montauk::service_log(line);
}
static bool load_settings(char* server, int server_cap) {