Thanks for sharing that script. It looks great. Just a couple of questions please:
1) I noticed that Pound does not seem to delete its .pid file upon terminating. At least, it does not when I do kill pid on it. So either this is a bug, or the kill command is too harsh of a way to stop Pound. This is why I was asking what is the proper way to tell Pound to shutdown.
2) I am using Fedora core 8 and apparently I do not have a killproc command. Does it work the same as kill?
3) One thing that may be a potential pitfall for this script and scripts like it - what happens if your pound lock file gets left around somehow from a previous run? If so then all future attempts to
start up the service will fail, saying that its already running when it is not. Perhaps it would be better to to do something like " ps `cat /var/run/pound.pid`| grep pound " to make sure that the pid is active and assigned to pound before confirming that it is indeed alive?
----- Original Message ----
From: Jacob Anderson <jwa@beyond-ordinary.com>
To: pound@apsis.ch
Sent: Tuesday, April 15, 2008 5:33:45 PM
Subject: RE: [Pound Mailing List] What is the proper way to shutdown pound?
---[ start of file ]---
#! /bin/bash
#
# pound Start/Stop the pound daemon.
#
# chkconfig: 2345 90 60
# description: pound is a reverse proxy for escrowing HTTP and HTTPS
# connections to a backend server.
# processname: /usr/local/sbin/pound
# config: /etc/pound/pound.conf and /etc/pound/pound-ssl.conf
# pidfile: /var/run/pound.pid
# Source function library.
. /etc/init.d/functions
if [ -e /etc/sysconfig/pound ]; then
. /etc/sysconfig/pound
fi
# See how we were called.
POUNDARGS="-v -f /etc/pound/pound.conf"
prog="pound"
POUND="/usr/local/sbin/pound"
start() {
echo -n $"Starting $prog: "
if [ -e /var/lock/subsys/pound ]; then
if [ -e /var/run/pound.pid ] && [ -e
/proc/`cat
/var/run/pound.pid` ]; then
echo -n $"cannot start pound: pound is already running.";
failure $"cannot start pound: pound already running.";
echo
return 1
fi
fi
daemon $POUND $POUNDARGS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/pound;
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
if [ ! -e /var/lock/subsys/pound ]; then
echo -n $"cannot stop pound: pound is not running."
failure $"cannot stop pound: pound is not running."
echo
return 1;
fi
killproc $POUND
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/pound;
return $RETVAL
}
rhstatus() {
status $POUND
}
restart() {
stop
start
}
reload() {
echo -n $"Reloading pound daemon configuration: "
killproc $POUND -HUP
RETVAL=$?
echo
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
status)
rhstatus
;;
condrestart)
[ -f /var/lock/subsys/pound ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
exit 1
esac
----[ end of file ]----
> -----Original Message-----
> From: Jacob Anderson [mailto:
jwa@beyond-ordinary.com]
> Sent: Tuesday, April 15, 2008 2:29 PM
> To:
pound@apsis.ch> Subject: RE: [Pound Mailing List] What is the proper way to shutdown
> pound?
>
> Attached is a pound control file that I wrote which handles the start
> and
> stop of pound via the "service" command or using /etc/rc.d/init.d
> scripts.
>
> Copy this file into /etc/rc.d/init.d (if you're on linux), chmod it so
> that
> you can run it, and then use /sbin/chkconfig to install it.
>
> Commands are simple:
>
> "pound stop"
> "pound start"
> "pound restart"
>
> -- Jake
>
>
> > -----Original Message-----
> > From: Rt Ibmer [mailto:
rtibmx@yahoo.com]
> > Sent: Tuesday, April 15, 2008 2:00 PM
> > To:
pound@apsis.ch> > Subject: [Pound Mailing List] What is the proper way to shutdown
> pound?
> >
> > What is the proper way
to shutdown pound? Should I use kill or kill -
> 9,
> > or something else? Is there a difference between using kill -9 vs
> kill
> > when it comes to pound? Thanks.
> >
> >
> >
> >
> >
> >
> _______________________________________________________________________
> > _____________
> > Be a better friend, newshound, and
> > know-it-all with Yahoo! Mobile. Try it now.
> >
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ> >
> > --
> > To unsubscribe send an email with subject unsubscribe to
> >
pound@apsis.ch.
> > Please contact
roseg@apsis.ch
for questions.
>
>
> --
> To unsubscribe send an email with subject unsubscribe to
>
pound@apsis.ch.
> Please contact
roseg@apsis.ch for questions.
--
To unsubscribe send an email with subject unsubscribe to
pound@apsis.ch.
Please contact
roseg@apsis.ch for questions.