mirror of
https://github.com/overte-org/overte.git
synced 2025-04-26 02:36:45 +02:00
Update process log paths to be absolute
This commit is contained in:
parent
08a845d3af
commit
d587ee0fe3
1 changed files with 12 additions and 11 deletions
|
@ -1,12 +1,13 @@
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
var request = require('request');
|
const request = require('request');
|
||||||
var extend = require('extend');
|
const extend = require('extend');
|
||||||
var util = require('util');
|
const util = require('util');
|
||||||
var events = require('events');
|
const events = require('events');
|
||||||
var childProcess = require('child_process');
|
const childProcess = require('child_process');
|
||||||
var fs = require('fs');
|
const fs = require('fs');
|
||||||
var os = require('os');
|
const os = require('os');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
const ProcessGroupStates = {
|
const ProcessGroupStates = {
|
||||||
STOPPED: 'stopped',
|
STOPPED: 'stopped',
|
||||||
|
@ -144,8 +145,8 @@ Process.prototype = extend(Process.prototype, {
|
||||||
if (logDirectoryCreated) {
|
if (logDirectoryCreated) {
|
||||||
// Create a temporary file with the current time
|
// Create a temporary file with the current time
|
||||||
var time = (new Date).getTime();
|
var time = (new Date).getTime();
|
||||||
var tmpLogStdout = this.logDirectory + '/' + this.name + '-' + time + '-stdout.txt';
|
var tmpLogStdout = path.resolve(this.logDirectory + '/' + this.name + '-' + time + '-stdout.txt');
|
||||||
var tmpLogStderr = this.logDirectory + '/' + this.name + '-' + time + '-stderr.txt';
|
var tmpLogStderr = path.resolve(this.logDirectory + '/' + this.name + '-' + time + '-stderr.txt');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
logStdout = fs.openSync(tmpLogStdout, 'ax');
|
logStdout = fs.openSync(tmpLogStdout, 'ax');
|
||||||
|
@ -175,7 +176,7 @@ Process.prototype = extend(Process.prototype, {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logStdout != 'ignore') {
|
if (logStdout != 'ignore') {
|
||||||
var pidLogStdout = './logs/' + this.name + "-" + this.child.pid + "-" + time + "-stdout.txt";
|
var pidLogStdout = path.resolve(this.logDirectory + '/' + this.name + "-" + this.child.pid + "-" + time + "-stdout.txt");
|
||||||
fs.rename(tmpLogStdout, pidLogStdout, function(e) {
|
fs.rename(tmpLogStdout, pidLogStdout, function(e) {
|
||||||
if (e !== null) {
|
if (e !== null) {
|
||||||
console.log("Error renaming log file from " + tmpLogStdout + " to " + pidLogStdout, e);
|
console.log("Error renaming log file from " + tmpLogStdout + " to " + pidLogStdout, e);
|
||||||
|
@ -186,7 +187,7 @@ Process.prototype = extend(Process.prototype, {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logStderr != 'ignore') {
|
if (logStderr != 'ignore') {
|
||||||
var pidLogStderr = './logs/' + this.name + "-" + this.child.pid + "-" + time + "-stderr.txt";
|
var pidLogStderr = path.resolve(this.logDirectory + '/' + this.name + "-" + this.child.pid + "-" + time + "-stderr.txt");
|
||||||
fs.rename(tmpLogStderr, pidLogStderr, function(e) {
|
fs.rename(tmpLogStderr, pidLogStderr, function(e) {
|
||||||
if (e !== null) {
|
if (e !== null) {
|
||||||
console.log("Error renaming log file from " + tmpLogStdout + " to " + pidLogStdout, e);
|
console.log("Error renaming log file from " + tmpLogStdout + " to " + pidLogStdout, e);
|
||||||
|
|
Loading…
Reference in a new issue