From 0bf7e4914817ffbb21c6bdc7cf04b6f76516d833 Mon Sep 17 00:00:00 2001 From: Andreas Fenkart Date: Mon, 12 May 2025 10:32:57 +0200 Subject: [PATCH] examples: fix unset OPTIONS variable warning in systemd services Modify chronyd.service to handle cases where OPTIONS is undefined, which occurs when /etc/sysconfig/chronyd doesn't exist or doesn't set the variable. This prevents the warning: "chronyd.service: Referenced but unset environment variable evaluates to an empty string: OPTIONS" --- examples/chronyd-restricted.service | 1 + examples/chronyd.service | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/chronyd-restricted.service b/examples/chronyd-restricted.service index 1894621..48f9a06 100644 --- a/examples/chronyd-restricted.service +++ b/examples/chronyd-restricted.service @@ -14,6 +14,7 @@ ConditionCapability=CAP_SYS_TIME [Service] Type=notify PIDFile=/run/chrony/chronyd.pid +Environment="OPTIONS=" EnvironmentFile=-/etc/sysconfig/chronyd ExecStart=/usr/sbin/chronyd -n -U $OPTIONS diff --git a/examples/chronyd.service b/examples/chronyd.service index e322454..b6b1742 100644 --- a/examples/chronyd.service +++ b/examples/chronyd.service @@ -8,6 +8,7 @@ ConditionCapability=CAP_SYS_TIME [Service] Type=notify PIDFile=/run/chrony/chronyd.pid +Environment="OPTIONS=" EnvironmentFile=-/etc/sysconfig/chronyd ExecStart=/usr/sbin/chronyd -n $OPTIONS