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