openvibers/openvibe.actor Commits
Listen on the socket systemd hands over, so a restart never answers 502 (#210)
Changes
@@@ -42,7 +42,10 @@ async function start() {// Personal agents' runs into their owners' Vibe chats (agents/vibe-deliver.js).ctx.vibeDelivery.start();-- const server = app.listen(config.port, config.host, () => {++ // Socket activation (2026-10-31): systemd's .socket unit holds the listener across restarts, so a deploy++ // queues requests in the kernel instead of answering 502. Without the socket unit, the usual listen.++ const socketActivated = process.env.LISTEN_FDS === '1' && Number(process.env.LISTEN_PID) === process.pid;++ const server = app.listen(...(socketActivated ? [{ fd: 3 }] : [config.port, config.host]), () => {const available = require('./agents/catalog').list(config).filter((a) => a.available).map((a) => a.id);console.log(`[Actor] ${config.nodeEnv} on http://${config.host}:${config.port} → ${config.baseUrl} (db ${ctx.s.db.store}); agents available: ${available.join(', ') || 'none'}`);});
@@ -42,7 +42,10 @@ async function start() {
@@ -42,7 +42,10 @@ async function start() {
// Personal agents' runs into their owners' Vibe chats (agents/vibe-deliver.js).
// Personal agents' runs into their owners' Vibe chats (agents/vibe-deliver.js).
ctx.vibeDelivery.start();
ctx.vibeDelivery.start();
- const server = app.listen(config.port, config.host, () => {
+ // Socket activation (2026-10-31): systemd's .socket unit holds the listener across restarts, so a deploy
+ // queues requests in the kernel instead of answering 502. Without the socket unit, the usual listen.
+ const socketActivated = process.env.LISTEN_FDS === '1' && Number(process.env.LISTEN_PID) === process.pid;
+ const server = app.listen(...(socketActivated ? [{ fd: 3 }] : [config.port, config.host]), () => {
const available = require('./agents/catalog').list(config).filter((a) => a.available).map((a) => a.id);
const available = require('./agents/catalog').list(config).filter((a) => a.available).map((a) => a.id);
console.log(`[Actor] ${config.nodeEnv} on http://${config.host}:${config.port} → ${config.baseUrl} (db ${ctx.s.db.store}); agents available: ${available.join(', ') || 'none'}`);
console.log(`[Actor] ${config.nodeEnv} on http://${config.host}:${config.port} → ${config.baseUrl} (db ${ctx.s.db.store}); agents available: ${available.join(', ') || 'none'}`);
});
});