jsatoh cad2924f25 2013-04-21 Junichi Satoh <junichi@rworks.jp>
* pandora_agent_installer: Added support for NetBSD.

	* NetBSD/pandora_agent, NetBSD/pandora_agent.conf: Added launcher
	script and configuration file for NetBSD.

	Contributed by Hiroki SHIMIZU. Thanks!



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8021 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-04-21 00:36:33 +00:00

52 lines
1015 B
Bash
Executable File

#!/bin/sh
# **********************************************************************
# Pandora FMS Agent Daemon launcher for NetBSD
# (c) 2013 Hiroki SHIMIZU <shimizu@rworks.jp>
#
# **********************************************************************
# PROVIDE: pandora_agent
# REQUIRE: LOGIN
# KEYWORD: shutdown
# Add the following line to /etc/rc.conf to enable `pandora_agent':
#
# pandora_agent="YES"
#
. "/etc/rc.subr"
name="pandora_agent"
rcvar=${name}
# read configuration and set defaults
pandora_agent=${pandora_agent:-"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/pkg/bin/perl"
start_postcmd()
{
sleep 1
PANDORA_PID=`pgrep -f none $name`
echo $PANDORA_PID > $pidfile
}
stop_postcmd()
{
rm -f $pidfile
}
run_rc_command "$1"