diff --git a/pandora_agents/ChangeLog b/pandora_agents/ChangeLog index 7d92e43dc4..1a4569a2ab 100644 --- a/pandora_agents/ChangeLog +++ b/pandora_agents/ChangeLog @@ -1,3 +1,10 @@ +2010-07-05 Junichi Satoh + + * unix/pandora_agent_installer: Fixed typo and directory permission + for FreeBSD. + + * unix/FreeBSD/pandora_agent: Simplified. + 2010-06-18 Ramon Novoa * unix/pandora_exec: Added to repository. pandora_exec script. diff --git a/pandora_agents/unix/ChangeLog b/pandora_agents/unix/ChangeLog index 98ca8f658c..d5abc813e3 100644 --- a/pandora_agents/unix/ChangeLog +++ b/pandora_agents/unix/ChangeLog @@ -1,3 +1,10 @@ +2010-07-05 Junichi Satoh + + * pandora_agent_installer: Fixed typo and directory permission + for FreeBSD. + + * FreeBSD/pandora_agent: Simplified. + 2010-07-02 Ramon Novoa * pandora_agent: Fixed a typo. diff --git a/pandora_agents/unix/FreeBSD/pandora_agent b/pandora_agents/unix/FreeBSD/pandora_agent index 7d878cef29..720eec9eda 100755 --- a/pandora_agents/unix/FreeBSD/pandora_agent +++ b/pandora_agents/unix/FreeBSD/pandora_agent @@ -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" diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 6b50172cc7..8c40c48633 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -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":