Closed mcscope closed 7 years ago
This is great. One request:
Since systemctl stop ...
sends a SIGTERM
and not a SIGINT
, can you also register the handler in main.cpp? (And probably rename sigIntHandler
to signalShutdownHandler
?) You can tell it's correctly shut down if it goes back to static after a few seconds.
Also, not for this PR, but if you have thoughts for how to gracefully shut these down at the burn without logging in, I'm all ears.
(A simple push switch and wire it up to a hardware interrupt, for example...)
I added documentation on how to configure the fm_transmitter to auto-start on boot, and on process failure. This uses systemd, which is the powerful new init system for linux. There's a single file that should be moved to /lib/systemd/system. I have included instructions for how to do this to the README, as well as some useful commands for interacting with systemd.
I envision we might want to alternate between usb auto and canned music, and unfortunately, I didn't find an easy way to change the command line options in the systemd script. There is some environmental variable schenanigans that we can do, or we could make two services, one for each option (
fm_transmit_live
,fm_transmit_canned
?)We're also working on a preconfigured image for the pi, and we aim to have this demonization pre-installed.
This addresses issue https://github.com/coup-de-foudre/FM_transmitter/issues/12