From owner-freebsd-questions@freebsd.org Mon Jan 11 11:57:40 2021 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2AF74D6086 for ; Mon, 11 Jan 2021 11:57:40 +0000 (UTC) (envelope-from freebsd-lists-5@thismonkey.com) Received: from mail-01.thismonkey.com (mail-01.thismonkey.com [IPv6:2406:3400:35e:6602::a01:232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "thismonkey.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDsdt5srSz3LkR for ; Mon, 11 Jan 2021 11:57:38 +0000 (UTC) (envelope-from freebsd-lists-5@thismonkey.com) Received: from mailhub-01.thismonkey.com (mailhub-01.thismonkey.com [IPv6:2406:3400:35e:6601:0:0:a01:11e]) by mail-01.thismonkey.com (8.15.2/8.15.2) with ESMTP id 10BBvOY7096460 for ; Mon, 11 Jan 2021 22:57:24 +1100 (EST) (envelope-from freebsd-lists-5@thismonkey.com) X-TM-Via-MX: mailhub-01.thismonkey.com Received: from utility-01.thismonkey.com (utility-01.thismonkey.com [IPv6:2406:3400:35e:6601:0:0:a01:120]) by mailhub-01.thismonkey.com (8.15.2/8.15.2) with ESMTPS id 10BBvOcE090835 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Mon, 11 Jan 2021 22:57:24 +1100 (AEDT) (envelope-from freebsd-lists-5@thismonkey.com) Received: from utility-01.thismonkey.com (localhost [127.0.0.1]) by utility-01.thismonkey.com (8.16.1/8.16.1) with ESMTP id 10BBvOPt094594 for ; Mon, 11 Jan 2021 22:57:24 +1100 (EST) (envelope-from freebsd-lists-5@thismonkey.com) Received: (from root@localhost) by utility-01.thismonkey.com (8.16.1/8.16.1/Submit) id 10BBvNob094593 for freebsd-questions@freebsd.org; Mon, 11 Jan 2021 22:57:23 +1100 (EST) (envelope-from freebsd-lists-5@thismonkey.com) Date: Mon, 11 Jan 2021 22:57:23 +1100 From: Scott To: freebsd-questions@freebsd.org Subject: Need help specifying args in rc.conf for a service Message-ID: Mail-Followup-To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Virus-Scanned: clamav-milter 0.102.2 at mail-01.thismonkey.com X-Virus-Status: Clean X-Rspamd-Queue-Id: 4DDsdt5srSz3LkR X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=thismonkey.com; spf=pass (mx1.freebsd.org: domain of freebsd-lists-5@thismonkey.com designates 2406:3400:35e:6602::a01:232 as permitted sender) smtp.mailfrom=freebsd-lists-5@thismonkey.com X-Spamd-Result: default: False [-3.80 / 15.00]; MID_RHS_MATCH_FROM(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2406:3400:35e:6602::a01:232:from]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2406:3400:35e:6602::a01:232:from:127.0.2.255]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[thismonkey.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:10143, ipnet:2406:3400:340::/42, country:AU]; RCVD_TLS_LAST(0.00)[]; MAILMAN_DEST(0.00)[freebsd-questions] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2021 11:57:40 -0000 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