summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rpm/init.d-mongod5
-rw-r--r--rpm/mongo.spec1
-rw-r--r--rpm/mongod.conf3
3 files changed, 7 insertions, 2 deletions
diff --git a/rpm/init.d-mongod b/rpm/init.d-mongod
index 62b45a5cffe..e9a6202ad9c 100644
--- a/rpm/init.d-mongod
+++ b/rpm/init.d-mongod
@@ -6,7 +6,7 @@
# description: Mongo is a scalable, document-oriented database.
# processname: mongod
# config: /etc/mongod.conf
-# pidfile: /var/run/mongo/mongo.pid
+# pidfile: /var/run/mongo/mongod.pid
. /etc/rc.d/init.d/functions
@@ -23,6 +23,7 @@ SYSCONFIG="/etc/sysconfig/mongod"
# shuts down the correct running pid, but that's unavailable in 1.8
# for now. This can go away when this script stops supporting 1.8.
DBPATH=`awk -F= '/^dbpath=/{print $2}' "$CONFIGFILE"`
+PIDFILE=`awk -F= '/^dbpath\s=\s/{print $2}' "$CONFIGFILE"`
mongod=${MONGOD-/usr/bin/mongod}
MONGO_USER=mongod
@@ -42,7 +43,7 @@ start()
stop()
{
echo -n $"Stopping mongod: "
- killproc -p "$DBPATH"/mongod.lock -d 300 /usr/bin/mongod
+ killproc -p "$PIDFILE" -d 300 /usr/bin/mongod
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/mongod
diff --git a/rpm/mongo.spec b/rpm/mongo.spec
index 618e41ac30d..7b34668c9c7 100644
--- a/rpm/mongo.spec
+++ b/rpm/mongo.spec
@@ -131,6 +131,7 @@ fi
#/etc/rc.d/init.d/mongos
%attr(0755,mongod,mongod) %dir /var/lib/mongo
%attr(0755,mongod,mongod) %dir /var/log/mongo
+%attr(0755,mongod,mongod) %dir /var/run/mongo
%attr(0640,mongod,mongod) %config(noreplace) %verify(not md5 size mtime) /var/log/mongo/mongod.log
%changelog
diff --git a/rpm/mongod.conf b/rpm/mongod.conf
index 73ff749534f..dbfcc502e3d 100644
--- a/rpm/mongod.conf
+++ b/rpm/mongod.conf
@@ -12,6 +12,9 @@ fork = true
dbpath=/var/lib/mongo
+# location of pidfile
+pidfilepath = /var/run/mongodb/mongod.pid
+
# Disables write-ahead journaling
# nojournal = true