Remove mongod.lock upon restart

This commit is contained in:
Jeff Morgan 2014-09-01 15:55:13 -07:00
parent c370a4cf89
commit 21f4ca0565
1 changed files with 1 additions and 4 deletions

View File

@ -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'