mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 15:45:07 -05:00
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"
This commit is contained in:
committed by
Miroslav Lichvar
parent
f5fdfee150
commit
0bf7e49148
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user