rlgwebd.js: Unlink control socket at startup.
Unlinking at shutdown doesn't work because at that time, the process is chroot'ed and unprivileged.
This commit is contained in:
parent
d0ea0471c0
commit
286626df57
1 changed files with 5 additions and 1 deletions
|
|
@ -992,7 +992,6 @@ function shutdown () {
|
||||||
httpServer.close();
|
httpServer.close();
|
||||||
httpServer.removeAllListeners('request');
|
httpServer.removeAllListeners('request');
|
||||||
ctlServer.close();
|
ctlServer.close();
|
||||||
fs.unlink(ctlsocket);
|
|
||||||
tslog("Shutting down...");
|
tslog("Shutting down...");
|
||||||
process.exit();
|
process.exit();
|
||||||
}
|
}
|
||||||
|
|
@ -1027,6 +1026,11 @@ if (process.getuid() != 0) {
|
||||||
|
|
||||||
var httpServer; // declare here so shutdown() can find it
|
var httpServer; // declare here so shutdown() can find it
|
||||||
|
|
||||||
|
/* This could be nonblocking, but nothing else can start yet anyway. */
|
||||||
|
if (fs.existsSync(ctlsocket)) {
|
||||||
|
fs.unlinkSync(ctlsocket);
|
||||||
|
}
|
||||||
|
|
||||||
/* Open the control socket before chrooting where it can't be found */
|
/* Open the control socket before chrooting where it can't be found */
|
||||||
var ctlServer = net.createServer(function (sock) {
|
var ctlServer = net.createServer(function (sock) {
|
||||||
sock.on('data', conHandler);
|
sock.on('data', conHandler);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue