[mrtg] Re: configs won't start

Tim Hogan tim at hoganzoo.com
Mon Dec 3 03:41:37 MET 2001


I am not sure if this will help you or not but here is the startup script
that I use.  You are welcome to use it but you may have to change some of
the variables.  I run a solaris system and I have this in /etc/init.d/mrtgd

#### START SCRIPT ####

#!/sbin/sh
#
# Startup script for MRTG in daemon mode
# Created: September 28, 2001 -- v1.0
#

PIDFILE="/usr/local/mrtg-2/cfg/hoganzoo.pid"
PATH=/bin:/usr/bin:/usr/local/bin
LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
export PATH LD_LIBRARY_PATH

case "$1" in
'start')
    #
    # This will check and make sure that mrtg is not running.  If mrtg is
running
    # then an error will be issued and no action taken.  If not then this
script
    # will remove a stale pid file and start the application.
    #
    if /usr/bin/pgrep -x -u 0 'mrtg' >/dev/null 2>&1; then
        echo "MRTG already running.  Please check for errors or manually
kill process.\r"
    else
        if /usr/bin/test -r /usr/local/mrtg-2/cfg/hoganzoo.pid; then
            rm /usr/local/mrtg-2/cfg/hoganzoo.pid
            /usr/local/mrtg-2/bin/mrtg --user=webadmin --
group=webadmin /usr/local/mrtg-2/cfg/hoganzoo.cfg --logging /var/adm/mrtglog
        else
            /usr/local/mrtg-2/bin/mrtg --user=webadmin --
group=webadmin /usr/local/mrtg-2/cfg/hoganzoo.cfg --logging /var/adm/mrtglog
        fi
    fi
    ;;

'stop')
    if [  -r $PIDFILE  -a  ! -z ${PIDFILE}  ]; then
            PID=`cat ${PIDFILE}`
    fi
    if [  ${PID:=0} -gt 1 -a  ! "X$PID" = "X "  ]; then
            /usr/bin/kill $PID
    else
            echo "Unable to read PID file, please manually kill process."
    fi
    ;;

*)
    echo "Usage: $0 { start | stop }"
    exit 1
    ;;
esac
exit 0


#### END SCRIPT ####

>
> On reboot mrtg is started via "perl /etc/rc.d/init.d/mrtg," in
> rc.local. Many of the configs will not start unless I delete the old
> PID's and launch my mrtg script again. All configs run as a daemon.
>
> Is there a way to resolve this?
>
> Raymond
>
>
> --
> Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
> Archive     http://www.ee.ethz.ch/~slist/mrtg
> FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
> WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi




--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list