[smokeping-users] Init and logrotate script

Chris de Vidal Chris at deVidal.tv
Tue Mar 8 20:31:16 MET 2005


I've written an init and logrotate script for Fedora Core 3.  Should work
on most RedHat-based systems.

Bugs?  Perhaps; I copied and modified another script.  Works for me.

Hacky?  A little bit, especally when I killall speedy_backend.  Fix it for
me if you're not happy with it :-)

To use:
touch /etc/init.d/smokeping
(Add the contents below)
chmod 700 /etc/init.d/smokeping
chkconfig smokeping on
service smokeping start



#! /bin/bash
# dund:         SmokePing
#
# chkconfig:    345 99 00
# description:  Network latency grapher

# Source function library.
. /etc/rc.d/init.d/functions

start()
{
        echo -n $"Starting smokeping: "
        cd /opt/smokeping
        daemon bin/smokeping --logfile /var/log/smokeping.log
        cd - &> /dev/null

        touch /var/lock/subsys/smokeping
        echo
}

stop()
{
        echo -n $"Shutting down smokeping: "
        killproc smokeping
        killall speedy_backend &> /dev/null

        rm -f  /var/lock/subsys/smokeping
        echo
}

[ -f /opt/smokeping/bin/smokeping ] || exit 0

# See how we were called.
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        stop
        start
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 1
esac

exit 0










I've also added a logrotate script.

To use:
touch /etc/logrotate.d/smokeping
(Add the contents below)


/var/log/smokeping.log {
        missingok
        compress
        notifempty
}








Enjoy!

CD

Have you ever lied, no matter the color?  I have.  Have you ever stolen
anything, no matter the value?  I have.  Have you ever lusted?  I have. 
Jesus said whoever looks at a woman with lustful intent has already
committed adultery with her in his heart.

We are lying, thieving, adulterers at heart and will face judgement one day.

There is good news for us!  "God shows his love for us in that while we
were still sinners, Christ died for us.  Since, therefore, we have now
been justified by his blood, much more shall we be saved by him from the
wrath of God." (Romans 5:8,9)

--
Unsubscribe mailto:smokeping-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:smokeping-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/smokeping-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the smokeping-users mailing list