co2mon icon indicating copy to clipboard operation
co2mon copied to clipboard

-P option crashes when run from a systemd service

Open chrisberkhout opened this issue 2 years ago • 0 comments

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.

chrisberkhout avatar Oct 14 '22 15:10 chrisberkhout