[Solved] Solution for Boost init.d for Gentoo

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
jaybode
Posts: 14
Joined: Tue Jul 10, 2012 8:08 am

[Solved] Solution for Boost init.d for Gentoo

Post by jaybode »

More a solution than a question.

Installing Boost today for the first time, after many years using Cacti.

Very good work, thanks to thewitness.

Just appending to the install README to support Gentoo Linux

Hopefully saves a Gentoo user some time to install Boost plugin :D

Code: Select all


       ------------------------------------------------------------------------
       Gentoo Linux - init.d Process: 
       ------------------------------------------------------------------------

       NOTE: this process is specific to Gentoo init.d

       a) vi /etc/init.d/cacti_boost with the following:
          
          
		#!/sbin/runscript
		# Copyright 1999-2012 Gentoo Foundation
		# Distributed under the terms of the GNU General Public License v2
		# $Header: $
		
		DEBUGLOG="/var/www/localhost/htdocs/cacti/log/boost.log"
		PROGPATH="/var/www/localhost/htdocs/cacti/plugins/boost/"
		PROG="boost_server.php"
		
		debug="1" # toggle 1 to turn off debugging
		
		depend() {
			need mysql
		}
	
		start() {
			ebegin "Starting Cacti Boost"
			if [ $debug = "1" ]; then
				start-stop-daemon --start --pidfile /var/run/boost.pid \
				--make-pidfile --exec $PROGPATH$PROG > $DEBUGLOG 2>&1 & 
			else
				start-stop-daemon --start --pidfile /var/run/boost.pid \
				--make-pidfile --exec $PROGPATH$PROG > /dev/null 2>&1 &
			fi
			eend $? "Failed to Cacti Boost"
		
		}
		
		stop() {
			ebegin "Stopping Cacti Boost"
			start-stop-daemon --stop --pidfile /var/run/boost.pid
			eend $? "Failed to stop Cacti Boost"
			sleep 1 
		}
		
		reload() {
			if [ ! -f /var/run/boost.pid ]; then
				eerror "Cacti Boost isn't running"
				return 1
			fi
			ebegin "Reloading configuration and re-opening log files"
			start-stop-daemon --signal HUP \
				--pidfile /var/run/boost.pid
			eend $?
		}
		
		restart() {
			stop
			start
		}



       b) Edit both boost_server.php and boost_rrdupdate.php and verify the PHP path
          in the first line of the file.

       c) Mark the boost_server.php and boost_rrdupdate.php files as executable:

          chmod +x boost_server.php
          chmod +x boost_rrdupdate.php

       d) If using an id other than root to update the rrdfiles mark the boost_server.php
          and boost_rrdupdate.php files setiud:

          chown root:root boost_server.php
          chmod +s boost_server.php
          chown root:root boost_rrdupdate.php
          chmod +s boost_rrdupdate.php

       e) Start the boost server using:

			boost # /etc/init.d/cacti_boost start
 			* Starting Cacti Boost ...       [ ok ]

       f) Stop and other commands to control boost server using:

			boost # /etc/init.d/cacti_boost stop
 			* Stopping Cacti Boost ...      [ ok ]
 			
 			boost # /etc/init.d/cacti_boost restart
 			 * Stopping Cacti Boost ...                                                                                                             [ ok ]
 			 * Starting Cacti Boost ... 
 			boost # /etc/init.d/cacti_boost status
 			 * status: started
 			
       f) Make sure it's running by issuing the following command:

          ps -ef | grep boost_server.php
          more /var/run/boost.pid 


    7) Finally, you can poll the server using telnet.  To do so, start a telnet
       session on the port you choose to use (default 9050) and type the
       "status" command followd by a carriage return.  You should receive a
       favorable response.
       
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests