From 21f4ca056525311f59f2c108494b508eff92a7ba Mon Sep 17 00:00:00 2001 From: Jeff Morgan Date: Mon, 1 Sep 2014 15:55:13 -0700 Subject: [PATCH] Remove mongod.lock upon restart --- index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/index.js b/index.js index 3a3d3a4989..9fe8b62b3e 100644 --- a/index.js +++ b/index.js @@ -43,10 +43,7 @@ var start = function (callback) { freeport(function(err, mongoPort) { console.log('MongoDB: ' + mongoPort); console.log('webPort: ' + webPort); - child_process.exec('kill $(ps aux -e | grep PURPOSE=KITEMATIC | awk \'{print $2}\')', function (error, stdout, stderr) { - console.log(error); - console.log(stdout); - console.log(stderr); + child_process.exec('kill $(ps aux -e | grep PURPOSE=KITEMATIC | awk \'{print $2}\') && rm ' + path.join(dataPath, 'mongod.lock'), function (error, stdout, stderr) { var mongoChild = child_process.spawn(path.join(process.cwd(), 'resources', 'mongod'), ['--bind_ip', '127.0.0.1', '--dbpath', dataPath, '--port', mongoPort, '--unixSocketPrefix', dataPath], { env: { PURPOSE: 'KITEMATIC'