[RDD] Can't stop Rivendell daemons in Ubuntu

Jay R. Ashworth jra at baylink.com
Tue Mar 4 18:13:05 EST 2008


On Thu, Feb 28, 2008 at 09:20:14PM +0000, Dan Mills wrote:
> On Thu, 2008-02-28 at 15:09 -0600, Michael Barnes wrote:
> > I can't seem to stop Rivendell in Ubuntu.  I do the
> > "/etc/init.d/rivendell stop" command and it gives no response and the
> > daemons just keep running.
> 
> Probably: sudo /etc/init.d/rivendell stop will do it, from an account
> that is allowed to sudo (by default only the first one you create
> can)....

This sounds like an altogether excellent time to post my
/usr/local/bin/svc script:

================
#!/bin/bash
# service helper script

# go to the directory
cd /etc/init.d

# if no argument, list services and exit
[ $# = 0 ] && ls && exit 0

# must exist (no longer check executable, since root will be able to run it)
[ -f $1 ] || { echo "$1: no such service" && exit 1; }

# if we're not root, fix it
[ $UID = 0 ] || exec su root -c "$0 $*"

# run the actual script
SCRIPT=$1
shift

case $1 in
        on)
                ./$SCRIPT start
                echo "Enabling $SCRIPT..."
                chkconfig $SCRIPT on
                exit 0
                ;;
        off)
                ./$SCRIPT stop
                echo "Disabling $SCRIPT..."
                chkconfig $SCRIPT off
                exit 0
                ;;
        bounce)
		 ./$SCRIPT stop
                ./$SCRIPT start
                exit 0
                ;;
        *)     
		 ./${SCRIPT} $*
                ;;
esac
================

This assumes chkconfig, and can be configured to whatever directory your
service control scripts live in.

Cheers,
-- jra
-- 
Jay R. Ashworth                   Baylink                      jra at baylink.com
Designer                     The Things I Think                       RFC 2100
Ashworth & Associates     http://baylink.pitas.com                     '87 e24
St Petersburg FL USA      http://photo.imageinc.us             +1 727 647 1274

	     Those who cast the vote decide nothing.
	     Those who count the vote decide everything.
	       -- (Joseph Stalin)



More information about the Rivendell-dev mailing list