19
19
# Default is ":9100".
20
20
# node_exporter_textfile_dir (string): Set directory that node_exporter will watch
21
21
# Default is "/var/tmp/node_exporter".
22
+ # node_exporter_pidfile (string): Set location of the node_exporter pidfile
23
+ # Default is "/var/run/node_exporter.pid".
22
24
23
25
. /etc/rc.subr
24
26
@@ -33,12 +35,12 @@ load_rc_config $name
33
35
: ${node_exporter_args:= " " }
34
36
: ${node_exporter_listen_address:= " :9100" }
35
37
: ${node_exporter_textfile_dir:= " /var/tmp/node_exporter" }
38
+ : ${node_exporter_pidfile:= " /var/run/node_exporter.pid" }
36
39
37
40
38
- pidfile=/var/run/node_exporter.pid
39
41
command=" /usr/sbin/daemon"
40
42
procname=" %%PREFIX%%/bin/node_exporter"
41
- command_args=" -f -p ${pidfile } -T ${name} \
43
+ command_args=" -f -p ${node_exporter_pidfile } -T ${name} \
42
44
/usr/bin/env ${procname} \
43
45
--web.listen-address=${node_exporter_listen_address} \
44
46
--collector.textfile.directory=${node_exporter_textfile_dir} \
@@ -48,11 +50,11 @@ start_precmd=node_exporter_startprecmd
48
50
49
51
node_exporter_startprecmd ()
50
52
{
51
- if [ ! -e ${pidfile } ]; then
53
+ if [ ! -e ${node_exporter_pidfile } ]; then
52
54
install \
53
55
-o ${node_exporter_user} \
54
56
-g ${node_exporter_group} \
55
- /dev/null ${pidfile } ;
57
+ /dev/null ${node_exporter_pidfile } ;
56
58
fi
57
59
if [ ! -d ${node_exporter_textfile_dir} ]; then
58
60
install \
0 commit comments