mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
updated loader to kickstart the web installer if no config is found
This commit is contained in:
15
loader.js
15
loader.js
@@ -246,7 +246,9 @@ nconf.argv().env().file({
|
|||||||
file: path.join(__dirname, '/config.json')
|
file: path.join(__dirname, '/config.json')
|
||||||
});
|
});
|
||||||
|
|
||||||
if (nconf.get('daemon') !== false) {
|
fs.open(path.join(__dirname, 'config.json'), 'r', function(err) {
|
||||||
|
if (!err) {
|
||||||
|
if (nconf.get('daemon') !== false) {
|
||||||
if (fs.existsSync(pidFilePath)) {
|
if (fs.existsSync(pidFilePath)) {
|
||||||
try {
|
try {
|
||||||
var pid = fs.readFileSync(pidFilePath, { encoding: 'utf-8' });
|
var pid = fs.readFileSync(pidFilePath, { encoding: 'utf-8' });
|
||||||
@@ -263,14 +265,19 @@ if (nconf.get('daemon') !== false) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
fs.writeFile(__dirname + '/pidfile', process.pid);
|
fs.writeFile(__dirname + '/pidfile', process.pid);
|
||||||
}
|
}
|
||||||
|
|
||||||
async.series([
|
async.series([
|
||||||
Loader.init,
|
Loader.init,
|
||||||
Loader.displayStartupMessages,
|
Loader.displayStartupMessages,
|
||||||
Loader.start
|
Loader.start
|
||||||
], function(err) {
|
], function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log('[loader] Error during startup: ' + err.message);
|
console.log('[loader] Error during startup: ' + err.message);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// No config detected, kickstart web installer
|
||||||
|
var child = require('child_process').fork('app');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
@@ -10,8 +10,7 @@
|
|||||||
},
|
},
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "./nodebb start",
|
"start": "node loader.js",
|
||||||
"stop": "./nodebb stop",
|
|
||||||
"test": "mocha ./tests -t 10000"
|
"test": "mocha ./tests -t 10000"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
Reference in New Issue
Block a user