co2mon
co2mon copied to clipboard
-P option crashes when run from a systemd service
Logs looked like this:
Oct 13 19:15:29 hostname systemd[1]: Started Polling daemon for masterkit co2monitor.
Oct 13 19:15:29 hostname co2mond[31973]: co2mond: signal(SIGPIPE, SIG_IGN): Success
Oct 13 19:15:29 hostname systemd[1]: co2mon.service: Main process exited, code=exited, status=1/FAILURE
Oct 13 19:15:29 hostname systemd[1]: co2mon.service: Failed with result 'exit-code'.
The same command was working outside of systemd and it took me a while to figure out that it wasn't a resource authorization issue.
It was failing at co2mond/src/main.c:692.
Adding IgnoreSIGPIPE=no
to the service definition avoids the problem.
Maybe there's a more graceful way to handle the signal(SIGPIPE, SIG_IGN)
response with systemd's default behavior.