@@ -33,14 +33,31 @@
rc_status -v
;;
stop)
- echo -n "Shutting down $prog: "
- /bin/kill -9 `/sbin/pidof exabgp`
- until [ -z $(/sbin/pidof exabgp) ]; do :; done
- rc_status -v
+ if [ -n "${ENVDIR}" ] ; then
+ PIDFILE=`grep ^pid /usr/share/exabgp/etc/exabgp.env | awk '{print $NF}'|sed -e s@[\'\"]@@g`
+ if [ -n "${PIDFILE}" ] ; then
+ echo -n "Shutting down $prog: "
+ kill `cat ${PIDFILE}`
+ rc_status -v
+ else
+ echo "Can't find pidfile from exabgp.env"
+ fi
+ else
+ echo "ENVDIR not defined int /etc/sysconfig/exabgp"
+ fi
;;
reload)
- /bin/kill -USR1 `/sbin/pidof exabgp`
- rc_status -v
+ if [ -n "${ENVDIR}" ] ; then
+ PIDFILE=`grep ^pid /usr/share/exabgp/etc/exabgp.env | awk '{print $NF}'|sed -e s@[\'\"]@@g`
+ if [ -n "${PIDFILE}" ] ; then
+ /bin/kill -USR1 `cat ${PIDFILE}`
+ rc_status -v
+ else
+ echo "Can't find pidfile from exabgp.env"
+ fi
+ else
+ echo "ENVDIR not defined int /etc/sysconfig/exabgp"
+ fi
;;
restart)
$0 stop
|