Need help specifying args in rc.conf for a service
Scott
freebsd-lists-5 at thismonkey.com
Mon Jan 11 11:57:40 UTC 2021
Hi all,
I posted this on the forums and was unsuccessful so I thought I'd try here:
I've been struggling to pass additional arguments to the Prometheus
node_exporter daemon in /etc/rc.conf.
The help for node_exporter provides an example argument (mount points to
ignore) as:
--collector.filesystem.ignored-mount-points="^/(dev)($|/)"
Regexp of mount points to ignore for filesystem collector.
The rc script says to use the _args variable to specify arguments to
node_exporter:
# node_exporter_args (string): Set extra arguments to pass to
# Default is "".
Adding the line:
node_exporter_args="--collector.filesystem.ignored-mount-points=\"^/(dev)($|/)\""
to /etc/rc.conf and running sh -x /usr/local/etc/rc.d/node_exporter start
results in:
+ limits -C daemon su -m nobody -c 'sh -c "/usr/sbin/daemon -f -p /var/run/node_exporter.pid -T node_exporter /usr/bin/env /usr/local/bin/node_exporter --web.listen-address=:9100 --collector.textfile.directory=/var/tmp/node_exporter --collector.filesystem.ignored-mount-points="^/(dev)($|/)""'
Illegal variable name.
It was suggested on the forum to try:
node_exporter_args='--collector.filesystem.ignored-mount-points="^/(dev)(\$|/)"'
# OR
node_exporter_args="--collector.filesystem.ignored-mount-points='^/(dev)($|/)'"
However with the first suggestion I got:
limits -C daemon su -m nobody -c 'sh -c "/usr/sbin/daemon -f -p /var/run/node_exporter.pid -T node_exporter /usr/bin/env /usr/local/bin/node_exporter --web.listen-address=:9100 --collector.textfile.directory=/var/tmp/node_exporter --collector.filesystem.ignored-mount-points="^/(dev)(\$|/)""'
Badly placed (.
and with the second I got:
eval $' limits -C daemon su -m nobody -c \'sh -c "/usr/sbin/daemon -f -p /var/run/node_exporter.pid -T node_exporter /usr/bin/env /usr/local/bin/node_exporter --web.listen-address=:9100 --collector.textfile.directory=/var/tmp/node_exporter --collector.filesystem.ignored-mount-points=\'^/(dev)($|/)\'"\''
eval: 1: Syntax error: "(" unexpected
Can anyone please help?
Thanks,
Scott
More information about the freebsd-questions
mailing list