View | Details | Raw Unified | Return to bug 226435 | Differences between
and this patch

Collapse All | Expand All

(-)sysutils/snmp_exporter/files/snmp_exporter.in (-3 / +6 lines)
Lines 22-27 Link Here
22
# snmp_exporter_config_file (string)    Set the location of the snmp_exporter config
22
# snmp_exporter_config_file (string)    Set the location of the snmp_exporter config
23
#                                       configuration file.
23
#                                       configuration file.
24
#               Default is "%%PREFIX%%/etc/snmp_exporter/snmp.yml"
24
#               Default is "%%PREFIX%%/etc/snmp_exporter/snmp.yml"
25
# snmp_exporter_log_file (string)       Set file that snmp_exporter will log to.
26
#               Default is "/var/log/snmp_exporter.log"
25
27
26
. /etc/rc.subr
28
. /etc/rc.subr
27
29
Lines 36-41 Link Here
36
: ${snmp_exporter_args:=""}
38
: ${snmp_exporter_args:=""}
37
: ${snmp_exporter_listen_address:=":9116"}
39
: ${snmp_exporter_listen_address:=":9116"}
38
: ${snmp_exporter_config_file:="%%PREFIX%%/etc/snmp_exporter/snmp.yml"}
40
: ${snmp_exporter_config_file:="%%PREFIX%%/etc/snmp_exporter/snmp.yml"}
41
: ${snmp_exporter_log_file:="/var/log/snmp_exporter.log"}
39
42
40
pidfile=/var/run/snmp_exporter.pid
43
pidfile=/var/run/snmp_exporter.pid
41
command="/usr/sbin/daemon"
44
command="/usr/sbin/daemon"
Lines 43-49 Link Here
43
command_args="-p ${pidfile} /usr/bin/env ${procname} \
46
command_args="-p ${pidfile} /usr/bin/env ${procname} \
44
    --web.listen-address=${snmp_exporter_listen_address} \
47
    --web.listen-address=${snmp_exporter_listen_address} \
45
    --config.file=${snmp_exporter_config_file} \
48
    --config.file=${snmp_exporter_config_file} \
46
    ${snmp_exporter_args}"
49
    ${snmp_exporter_args} >> ${snmp_exporter_log_file} 2>&1"
47
50
48
start_precmd=snmp_exporter_startprecmd
51
start_precmd=snmp_exporter_startprecmd
49
52
Lines 52-59 Link Here
52
    if [ ! -e ${pidfile} ]; then
55
    if [ ! -e ${pidfile} ]; then
53
        install -o ${snmp_exporter_user} -g ${snmp_exporter_group} /dev/null ${pidfile};
56
        install -o ${snmp_exporter_user} -g ${snmp_exporter_group} /dev/null ${pidfile};
54
    fi
57
    fi
55
    if [ ! -d ${snmp_exporter_textfile_dir} ]; then
58
    if [ ! -f ${snmp_exporter_log_file} ]; then
56
        install -d -o ${snmp_exporter_user} -g ${snmp_exporter_group} -m 1755 ${snmp_exporter_textfile_dir}
59
        install -o ${snmp_exporter_user} -g ${snmp_exporter_group} -m 640 /dev/null ${snmp_exporter_log_file}
57
    fi
60
    fi
58
}
61
}
59
62

Return to bug 226435