kopia lustrzana https://github.com/OpenDroneMap/NodeODM
clone, keep process env vars
rodzic
27ed79a5a3
commit
2f54e12470
|
@ -22,6 +22,7 @@ let assert = require('assert');
|
||||||
let spawn = require('child_process').spawn;
|
let spawn = require('child_process').spawn;
|
||||||
let config = require('../config.js');
|
let config = require('../config.js');
|
||||||
let logger = require('./logger');
|
let logger = require('./logger');
|
||||||
|
let utils = require('./utils');
|
||||||
|
|
||||||
|
|
||||||
function makeRunner(command, args, requiredOptions = [], outputTestFile = null){
|
function makeRunner(command, args, requiredOptions = [], outputTestFile = null){
|
||||||
|
@ -58,11 +59,9 @@ function makeRunner(command, args, requiredOptions = [], outputTestFile = null){
|
||||||
}
|
}
|
||||||
|
|
||||||
// Launch
|
// Launch
|
||||||
let childProcess = spawn(command, commandArgs, {
|
const env = utils.clone(process.env);
|
||||||
env:{
|
env.LD_LIBRARY_PATH = path.join(config.odm_path, "SuperBuild", "install", "lib");
|
||||||
LD_LIBRARY_PATH: path.join(config.odm_path, "SuperBuild", "install", "lib")
|
let childProcess = spawn(command, commandArgs, { env });
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
childProcess
|
childProcess
|
||||||
.on('exit', (code, signal) => done(null, code, signal))
|
.on('exit', (code, signal) => done(null, code, signal))
|
||||||
|
|
|
@ -44,5 +44,9 @@ module.exports = {
|
||||||
const safeSuffix = path.normalize(p).replace(/^(\.\.(\/|\\|$))+/, '');
|
const safeSuffix = path.normalize(p).replace(/^(\.\.(\/|\\|$))+/, '');
|
||||||
return path.join('./', safeSuffix);
|
return path.join('./', safeSuffix);
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
clone: function(json){
|
||||||
|
return JSON.parse(JSON.stringify(json));
|
||||||
}
|
}
|
||||||
};
|
};
|
|
@ -7,7 +7,6 @@ PIDFile=/run/nodeodm.pid
|
||||||
User=odm
|
User=odm
|
||||||
Group=odm
|
Group=odm
|
||||||
WorkingDirectory=/www
|
WorkingDirectory=/www
|
||||||
Environment="HOME=/www/data"
|
|
||||||
ExecStart=/usr/bin/node index.js
|
ExecStart=/usr/bin/node index.js
|
||||||
ExecStop=/bin/kill -s QUIT $MAINPID
|
ExecStop=/bin/kill -s QUIT $MAINPID
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
Ładowanie…
Reference in New Issue