This repository was archived by the owner on Apr 20, 2023. It is now read-only.
This repository was archived by the owner on Apr 20, 2023. It is now read-only.
Make it compatible with express #11
Closed
Description
I tried integrating systemd socket activation with express app,
so in my express app.js,
require('systemd')
...
var http = require('http')
var port = process.env.LISTEN_PID > 0 ? 'systemd' : process.env.PORT || 4000
http.createServer(app).listen(port);
console.log('Express app started on port '+port);
I received the following error,
Express app started on port systemd
Apr 01 16:58:52 : events.js:72
Apr 01 16:58:52 : throw er; // Unhandled 'error' event
Apr 01 16:58:52 : ^
Apr 01 16:58:52 : Error: listen ENOTSOCK
Apr 01 16:58:52 : at errnoException (net.js:904:11)
Apr 01 16:58:52 : at Server._listen2 (net.js:1042:14)
Apr 01 16:58:52 : at Server.listen (/www/.../node_modules/systemd/lib/systemd.js:17:14)
I digged around a bit but have no idea, it seems that process.env.LISTEN_FDS is mysteriously gone in systemd.js