jsatoh f2d39acd67 2010-09-27 Junichi Satoh <junichi@rworks.jp>
* unix/FreeBSD/pandora_agent: Fixed a typo.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3297 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-27 02:06:34 +00:00

52 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
# **********************************************************************
# Pandora FMS Agent Daemon launcher for FreeBSD
# (c) 2010 Junichi Satoh <junichi@rworks.jp>
#
# **********************************************************************
# PROVIDE: pandora_agent
# REQUIRE: LOGIN
# KEYWORD: shutdown
# Add the following line to /etc/rc.conf to enable `pandora_agent':
#
# pandora_agent_enable="YES"
#
. "/etc/rc.subr"
name="pandora_agent"
rcvar=`set_rcvar`
# read configuration and set defaults
pandora_agent_enable=${pandora_agent_enable:-"NO"}
load_rc_config "$name"
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
command=/usr/local/bin/pandora_agent
command_args="/usr/local/etc/pandora &"
pidfile=/var/run/$name.pid
required_files="/usr/local/etc/pandora/pandora_agent.conf"
start_postcmd=start_postcmd
stop_postcmd=stop_postcmd
procname="/usr/bin/perl"
start_postcmd()
{
sleep 1
PANDORA_PID=`pgrep -f -j none $name`
echo $PANDORA_PID > $pidfile
}
stop_postcmd()
{
rm -f $pidfile
}
run_rc_command "$1"