Skip to content
Browse files

stop command

  • Loading branch information...
1 parent e04b9e0 commit df9af85e08a9e8363756f879b2ca33dc0783f939 @jgallen23 committed May 3, 2012
Showing with 11 additions and 4 deletions.
  1. +11 −4 bin/mongroup
View
15 bin/mongroup
@@ -20,7 +20,7 @@ usage() {
start [app] start [app] or all apps
restart [app] restart [app] or all apps
- stop not implemented yet
+ stop [app] stops [app] or all apps
status shows the status of all running apps
log [app] tail the [app]'s log or all apps
logf [app] tail -f the [app]'s log or all apps
@@ -77,8 +77,7 @@ start() {
do
if [ -z "$app" -o "$app" == "${NAMES[i]}" ]; then
echo "starting ${NAMES[i]} (${CMDS[i]})"
- mon -d -p $PIDS/${NAMES[i]}.pid -l $LOGS/${NAMES[i]}.log "${CMDS[i]}"
- #TODO: write out mon pid for stop command
+ mon -d -p $PIDS/${NAMES[i]}.pid -m $PIDS/${NAMES[i]}.mon.pid -l $LOGS/${NAMES[i]}.log "${CMDS[i]}"
fi
done
}
@@ -104,7 +103,15 @@ restart() {
}
stop() {
- echo "not implemented yet"
+ read_config
+ local app=$1
+ for i in ${!NAMES[@]}
+ do
+ if [ -z "$app" -o "$app" == "${NAMES[i]}" ]; then
+ echo "stopping ${NAMES[i]}"
+ kill -s SIGTERM $(cat $PIDS/${NAMES[i]}.mon.pid)
+ fi
+ done
}
tail_log() {

0 comments on commit df9af85

Please sign in to comment.
Something went wrong with that request. Please try again.