Permalink
Browse files

Specify the parent pid when shelling out to systemd-notify

Otherwise the systemd complains about "reception only permitted for
main PID". NotifyAccess is set to "all" in the service file because the
version of systemd I'm targeting doesn't yet support "exec", which
would otherwise be preferred.
  • Loading branch information...
lovett committed Jan 6, 2019
1 parent bb517c6 commit fb236cf547850198b782114f1ff2e9e4d46c9123
Showing with 2 additions and 1 deletion.
  1. +1 −0 ansible/templates/notifer.service.j2
  2. +1 −1 server/server.ts
@@ -4,6 +4,7 @@ After=network.target

[Service]
Type=notify
NotifyAccess=all
User=notifier
Group=notifier
WorkingDirectory={{ installation_directory }}
@@ -240,7 +240,7 @@ if (!module.parent) {

server.on('listening', () => {
process.stdout.write(`Listening on ${ip}:${port}\n`);
childProcess.exec('/bin/systemd-notify --ready');
childProcess.exec(`/bin/systemd-notify --ready --pid=${process.pid}`);
});
})
.catch((err) => {

0 comments on commit fb236cf

Please sign in to comment.