diff --git a/app.js b/app.js index d8b9564..4d6abb3 100644 --- a/app.js +++ b/app.js @@ -76,17 +76,23 @@ async function main() { args: chromeArgs, executablePath: "/usr/bin/chromium-browser", handleSIGINT: false, + handleSIGTERM: false }); page = await browser.newPage(); - // Manual handling on SIGINT to gracefully hangup and exit - process.on("SIGINT", async () => { + async function shutdown() { console.log("Exiting..."); - await page.close(); + //await page.close(); browser.close(); console.log("Done!"); process.exit(); - }); + } + + // Manual handling on SIGINT to gracefully hangup and exit + process.on("SIGINT", shutdown); + + // Manual handling on SIGINT to gracefully hangup and exit + process.on("SIGTERM", shutdown); // Start Jitsi Meet await page.goto(url); diff --git a/jitsi-headless.service b/jitsi-headless.service index 499fcf2..5a31e0c 100644 --- a/jitsi-headless.service +++ b/jitsi-headless.service @@ -1,6 +1,6 @@ [Unit] Description=headless jitsi client -After=network.target +After=network.target picar-control.service [Service] Type=simple