rlgwebd.js: fix reference error
httpServer needs to be in the global scope so shutdown() can find it.
This commit is contained in:
parent
bb17dd58a2
commit
7e352fcc20
1 changed files with 3 additions and 1 deletions
|
|
@ -689,6 +689,8 @@ if (process.getuid() != 0) {
|
|||
process.exit(1);
|
||||
}
|
||||
|
||||
var httpServer; // declare here so shutdown() can find it
|
||||
|
||||
/* Open the control socket before chrooting where it can't be found */
|
||||
var ctlServer = net.createServer(function (sock) {
|
||||
sock.on('data', conHandler);
|
||||
|
|
@ -719,7 +721,7 @@ ctlServer.listen(ctlsocket, function () {
|
|||
tslog("Could not drop permissions: %s", err);
|
||||
process.exit(1);
|
||||
}
|
||||
var httpServer = http.createServer(webHandler);
|
||||
httpServer = http.createServer(webHandler);
|
||||
httpServer.listen(8080, "127.0.0.1");
|
||||
tslog('rlgwebd running at http://127.0.0.1:8080/');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue