blob: aff066450d1fa0e009c77ad5664099e39e1d14cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
From 77f78f64c192572e6eb956b0fe28ecd975ff6461 Mon Sep 17 00:00:00 2001
From: Thomas Dziedzic <gostrc@gmail.com>
Date: Tue, 10 Apr 2012 19:38:58 -0500
Subject: [PATCH 2/2] Backport for mongodb 2.0.4 "Don't check /proc/pid/exe in
--shutdown SERVER-5358"
Backported to fix https://jira.mongodb.org/browse/SERVER-5358
https://github.com/mongodb/mongo/commit/c28d97d1a14a36ffc056bfd9ba7262b0a1509b5b
---
db/db.cpp | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/db/db.cpp b/db/db.cpp
index b1d1db8..0a21f4d 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;
--
1.7.10
|