From: Andreas Fenkart Date: Mon, 12 May 2025 08:32:57 +0000 (+0200) Subject: examples: fix unset OPTIONS variable warning in systemd services X-Git-Tag: 4.7-pre1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0bf7e4914817ffbb21c6bdc7cf04b6f76516d833;p=thirdparty%2Fchrony.git 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" --- diff --git a/examples/chronyd-restricted.service b/examples/chronyd-restricted.service index 18946210..48f9a065 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 e3224543..b6b17426 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