diff options
author | Benety Goh <benety@mongodb.com> | 2014-08-20 15:09:46 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2014-08-20 15:09:46 -0400 |
commit | a8d7c7b8559e8a4fe85e13de459a961099e8a04d (patch) | |
tree | e5647ac16e8a9eefcfb3d5dbc6e649f727535c0b /rpm | |
parent | 71277e8a5d072fbfa956a74f3c0295f69ead120f (diff) | |
download | mongo-a8d7c7b8559e8a4fe85e13de459a961099e8a04d.tar.gz |
SERVER-9253 added pid_file argument to mongo_killproc. New usage: mongo_killproc pid_file procname
Diffstat (limited to 'rpm')
-rwxr-xr-x | rpm/init.d-mongod | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/rpm/init.d-mongod b/rpm/init.d-mongod index 824ff68f164..a4777f45d4b 100755 --- a/rpm/init.d-mongod +++ b/rpm/init.d-mongod @@ -72,7 +72,7 @@ start() stop() { echo -n $"Stopping mongod: " - mongo_killproc $mongod + mongo_killproc "$PIDFILEPATH" $mongod RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/mongod @@ -90,10 +90,11 @@ restart () { # the initial TERM signal. mongo_killproc() { - local procname=$1 + local pid_file=$1 + local procname=$2 local -i delay=300 local -i duration=10 - local pid=`pidofproc -p "$PIDFILEPATH" $procname` + local pid=`pidofproc -p "${pid_file}" ${procname}` kill -TERM $pid >/dev/null 2>&1 usleep 100000 @@ -106,7 +107,7 @@ mongo_killproc() kill -KILL $pid >/dev/null 2>&1 usleep 100000 - rm -f "$PIDFILEPATH" + rm -f "${pid_file}" checkpid $pid local RC=$? |