#!/usr/bin/env node 'use strict'; const { Supervisor } = require('./supervisor'); const supervisor = new Supervisor(process.argv[2] || 'reader'); supervisor.start(); const keepalive = setInterval(() => {}, 60000); let closing = false; for (const signal of ['SIGINT', 'SIGTERM']) process.on(signal, async () => { if (closing) return; closing = true; clearInterval(keepalive); await supervisor.close(); process.exit(0); });