summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2012-04-10 17:34:52 -0400
committerAndy Schwerin <schwerin@10gen.com>2012-04-19 17:33:04 -0400
commit264b914c4b19e3e6e094d49761e85e9555b49957 (patch)
tree81de0750147261cfec4883fd62dbe544a5a3df22
parent1911459b0dd643506afe9f0280288090fa123a06 (diff)
downloadmongo-264b914c4b19e3e6e094d49761e85e9555b49957.tar.gz
Don't check /proc/pid/exe in --shutdown SERVER-5358
It didn't mix well with updates. When the mongod binary is updated the exe link gets " (deleted)" added to the path.
-rw-r--r--db/db.cpp16
1 files changed, 0 insertions, 16 deletions
diff --git a/db/db.cpp b/db/db.cpp
index b1d1db8054d..0a21f4d19af 100644
--- a/db/db.cpp
+++ b/db/db.cpp
@@ -989,22 +989,6 @@ int main(int argc, char* argv[]) {
procPath = (str::stream() << "/proc/" << pid);
if (!boost::filesystem::exists(procPath))
failed = true;
-
- string exePath = procPath + "/exe";
- if (boost::filesystem::exists(exePath)){
- char buf[256];
- int ret = readlink(exePath.c_str(), buf, sizeof(buf)-1);
- buf[ret] = '\0'; // readlink doesn't terminate string
- if (ret == -1) {
- int e = errno;
- cerr << "Error resolving " << exePath << ": " << errnoWithDescription(e);
- failed = true;
- }
- else if (!endsWith(buf, "mongod")){
- cerr << "Process " << pid << " is running " << buf << " not mongod" << endl;
- ::exit(-1);
- }
- }
}
catch (const std::exception& e){
cerr << "Error reading pid from lock file [" << name << "]: " << e.what() << endl;