2010-07-05 Junichi Satoh <junichi@rworks.jp>
* unix/pandora_agent_installer: Fixed typo and directory permission for FreeBSD. * unix/FreeBSD/pandora_agent: Simplified. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2958 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
4d53e4fb43
commit
3e4130c0f8
|
@ -1,3 +1,10 @@
|
|||
2010-07-05 Junichi Satoh <junichi@rworks.jp>
|
||||
|
||||
* unix/pandora_agent_installer: Fixed typo and directory permission
|
||||
for FreeBSD.
|
||||
|
||||
* unix/FreeBSD/pandora_agent: Simplified.
|
||||
|
||||
2010-06-18 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* unix/pandora_exec: Added to repository. pandora_exec script.
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
2010-07-05 Junichi Satoh <junichi@rworks.jp>
|
||||
|
||||
* pandora_agent_installer: Fixed typo and directory permission
|
||||
for FreeBSD.
|
||||
|
||||
* FreeBSD/pandora_agent: Simplified.
|
||||
|
||||
2010-07-02 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* pandora_agent: Fixed a typo.
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
. "/etc/rc.subr"
|
||||
|
||||
name="pandora_agent"
|
||||
rcvar=`set_rcvar`
|
||||
|
||||
# read configuration and set defaults
|
||||
pandora_agent_enable=${pandora_agent_enable:-"NO"}
|
||||
|
@ -27,39 +28,24 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
|
|||
|
||||
command=/usr/local/bin/pandora_agent
|
||||
command_args="/usr/local/etc/pandora &"
|
||||
procname=pandora_agent
|
||||
|
||||
pidfile=/var/run/$name.pid
|
||||
required_files="/usr/local/etc/pandora/pandora_agent.conf"
|
||||
start_precmd=start_precmd
|
||||
start_postcmd=start_postcmd
|
||||
stop_cmd=pandora_agent_stop
|
||||
stop_postcmd=stop_postcmd
|
||||
|
||||
start_precmd()
|
||||
{
|
||||
if [ -f $pidfile ]; then
|
||||
PANDORA_PID=`cat $pidfile`
|
||||
echo "pandora_agent is currently running on this machine with PID $PANDORA_PID"
|
||||
echo "Cannot launch again. Aborting."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
procname="/usr/bin/perl"
|
||||
|
||||
start_postcmd()
|
||||
{
|
||||
sleep 1
|
||||
PANDORA_PID=`ps auxww | grep $command | grep -v grep | head -1 | awk '{ print $2 }'`
|
||||
echo $PANDORA_PID > $pidfile
|
||||
}
|
||||
|
||||
pandora_agent_stop()
|
||||
stop_postcmd()
|
||||
{
|
||||
if [ -f $pidfile ]; then
|
||||
echo "Stopping pandora_agent."
|
||||
kill `cat $pidfile`
|
||||
rm -f $pidfile
|
||||
else
|
||||
echo "pandora_agent is not running."
|
||||
fi
|
||||
rm -f $pidfile
|
||||
}
|
||||
|
||||
run_rc_command "$1"
|
||||
|
|
|
@ -257,6 +257,7 @@ install () {
|
|||
chown root:wheel $PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG
|
||||
chown root:daemon $PANDORA_BASE$PANDORA_TEMP
|
||||
chmod -R 770 $PANDORA_BASE$PANDORA_TEMP
|
||||
chmod 775 $PANDORA_BASE$PANDORA_TEMP
|
||||
else
|
||||
chown root:root $PANDORA_BASE$PANDORA_LOG_DIR/$PANDORA_LOG
|
||||
fi
|
||||
|
@ -399,7 +400,7 @@ install () {
|
|||
echo " "
|
||||
if [ "$OS_NAME" = "FreeBSD" ]
|
||||
then
|
||||
echo "Define 'pandora_agent=\"YES\"' in /etc/rc.conf to enable the daemon."
|
||||
echo "Define 'pandora_agent_enable=\"YES\"' in /etc/rc.conf to enable the daemon."
|
||||
else
|
||||
echo "Check your startup configuration to be sure Pandora FMS Agent is ready "
|
||||
echo "to start automatically when system restarts":
|
||||
|
|
Loading…
Reference in New Issue