Skip to content
Browse files

allow log file configuration and change the stop command

Added a way to configure the log file location (default is
/usr/local/mongodb/log/mongod.log) and changed the stop command to use
"kill -15" instead of "kill -2" since "kill -2" didn't seem to work.
  • Loading branch information...
1 parent cc99107 commit ac256faedffac3abea53a92d699cf30d6709a519 Jeff Sawatzky committed Apr 11, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 MongoDB/MongoDB
View
9 MongoDB/MongoDB
@@ -10,11 +10,12 @@ test -r /etc/rc.common || exit 1
. /etc/rc.common
# Set up some defaults
-DBPATH="/usr/local/mongodb/db"
+DBPATH='/usr/local/mongodb/db'
+LOGPATH='/usr/local/mongodb/log/mongod.log'
MONGOD_PORT=27017
StartService(){
- /usr/local/mongodb/bin/mongod run --dbpath=$DBPATH --port $MONGOD_PORT > /dev/null 2>&1 &
+ /usr/local/mongodb/bin/mongod run --dbpath=$DBPATH --logpath=$LOGPATH --port $MONGOD_PORT > /dev/null 2>&1 &
}
StopService() {
@@ -29,10 +30,10 @@ StopService() {
if [ "$pid" == "" ]; then
pid=`/usr/sbin/lsof -i tcp:$MONGOD_PORT | tail -1 | awk '{print $2}'`
fi
-
+
# If we've found a PID, let's kill it
if [ "$pid" != "" ]; then
- kill -2 $pid
+ kill -15 $pid
fi
}

0 comments on commit ac256fa

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