Date: Mon, 11 Jan 2021 22:57:23 +1100 From: Scott <freebsd-lists-5@thismonkey.com> To: freebsd-questions@freebsd.org Subject: Need help specifying args in rc.conf for a service Message-ID: <X/w9IwVAFXyDr/ir@thismonkey.com>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?X/w9IwVAFXyDr/ir>