#!/bin/sh # $FreeBSD: head/net-mgmt/nrpe3/files/nrpe3.in 445504 2017-07-11 16:50:03Z zeising $ # # PROVIDE: nrpe3 # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable nrpe3: # nrpe3_enable (bool): Set to "NO" by default. # Set it to "YES" to enable nrpe3. # nrpe3_flags (str): Not set by default. # nrpe3_configfile (str): Set to "%%PREFIX%%/etc/nrpe.cfg" by default. . /etc/rc.subr name=nrpe3 rcvar=nrpe3_enable load_rc_config "${name}" : ${nrpe3_enable:=NO} : ${nrpe3_configfile:=%%PREFIX%%/etc/nrpe.cfg} required_files="${nrpe3_configfile}" command="%%PREFIX%%/sbin/nrpe3" command_args="-c ${nrpe3_configfile} -d" extra_commands=reload sig_reload=HUP start_precmd=nrpe3_prestart stop_precmd=find_pidfile find_pidfile() { [ -n "$nrpe3_pidfile" ] && warn "No longer necessary to set nrpe3_pidfile in rc.conf[.local]" if get_pidfile_from_conf pid_file ${nrpe3_configfile}; then pidfile="$_pidfile_from_conf" else pidfile='%%PIDDIR%%/nrpe3.pid' fi } nrpe3_prestart() { find_pidfile install -d -o ${nrpe_user:-nagios} ${pidfile%/*} } run_rc_command "$1"