On 04/13/2011 05:48 PM, Steve Linabery wrote:
initscripts for deltacloud-core services were not checking process
status in start() section.
Also reordered the killproc/RETVAL in the stop() method.
---
recipes/aeolus_recipe/templates/deltacloud-core | 24 ++++++++++++++--------
1 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/recipes/aeolus_recipe/templates/deltacloud-core
b/recipes/aeolus_recipe/templates/deltacloud-core
index 05e27bf..d5cd141 100644
--- a/recipes/aeolus_recipe/templates/deltacloud-core
+++ b/recipes/aeolus_recipe/templates/deltacloud-core
@@ -25,24 +25,30 @@ PROG=/usr/bin/deltacloudd
start() {
echo -n "Starting deltacloud-<%= name %>: "
- $PROG -i $DRIVER -e $ENV -p $PORT >> $LOGFILE 2>&1 &
- RETVAL=$?
- echo $! > $PIDFILE
- if [ $RETVAL -eq 0 ] && touch $LOCKFILE ; then
- echo_success
- echo
+ if test -f $LOCKFILE ; then
+ echo_success
+ echo
else
- echo_failure
- echo
+ $PROG -i $DRIVER -e $ENV -p $PORT >> $LOGFILE 2>&1 &
+ RETVAL=$?
+ echo $! > $PIDFILE
+ if [ $RETVAL -eq 0 ] && touch $LOCKFILE ; then
+ echo_success
+ echo
+ else
+ echo_failure
+ echo
+ fi
fi
}
stop() {
echo -n "Shutting down deltacloud-<%= name %>: "
- RETVAL=$?
+
# FIXME! we need to do a killproc -p <pidfile> here to ensure other
deltacloud
# daemons are not killed as well
killproc -p $PIDFILE deltacloudd
+ RETVAL=$?
if [ $RETVAL -eq 0 ] && rm -f $LOCKFILE ; then
echo_success
echo
ACK. Work for me.
-Mo