Gracefully handle absence of environment configuration file (#3062)
node_exporter has reasonable defaults so it is able to start without explicit config. Such a setup is common in /usr/-only images where /etc/ is an empty tmpfs upon boot. Signed-off-by: Nils K <24257556+septatrix@users.noreply.github.com>
This commit is contained in:
parent
076cc405d9
commit
715a2ed674
|
@ -4,7 +4,9 @@ Requires=node_exporter.socket
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=node_exporter
|
User=node_exporter
|
||||||
EnvironmentFile=/etc/sysconfig/node_exporter
|
# Fallback when environment file does not exist
|
||||||
|
Environment=OPTIONS=
|
||||||
|
EnvironmentFile=-/etc/sysconfig/node_exporter
|
||||||
ExecStart=/usr/sbin/node_exporter --web.systemd-socket $OPTIONS
|
ExecStart=/usr/sbin/node_exporter --web.systemd-socket $OPTIONS
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
Loading…
Reference in New Issue