xorbit / LiFePO4wered-Pi

Access library, command line tool and daemon for the LiFePO4wered/Pi module
GNU General Public License v2.0
132 stars 31 forks source link

Fix systemd sd_notify conditional and add additional notifications #43

Closed Jookia closed 4 years ago

Jookia commented 4 years ago

When doing my foreground PR I forgot to change 'if (sd_notify(0, "STATUS=Startup") == 0)' back to 'sd_notify(0, "STATUS=Startup");'. As a result if a systemd is using systemd but sd_notify isn't working for whatever reason, the system will run in the foreground but not set the foreground flag. Currently this only logs to syslog which isn't incorrect, but any future changes will make this a worse bug.

I also added notification when the daemon shuts down. Not too important but it completes the trio of starting/running/shutting down.