The services section of the Admin page doesn’t handle disabled services well. The page assumes a service is either running or dead, but doesn’t handle a situation where a service is loaded, but purposefully disabled.
As an example, I have Emoncms running on a CentOS host that also has the mosquitto MQTT package installed. This package includes both the mosquitto binary utilities, and the mosquitto systemd .service file. The service is loaded and disabled by default. I happen to have my MQTT broker running on another machine, so I’ve left it disabled on the Emoncms host. When the Admin page loads, it sees that the mosquitto service exists and is dead, and indicates this with a red dot next to the mosquitto service in the services listing.
I’ve modified my local installation to also check the “UnitFileState” as reported by the “systemctl show” command, and display disabled services with a grey dot. I’d be happy to contribute this change back, but would like to get some feedback from the community first. Is this the best way to handle this situation? Would it be preferable to not list disabled services at all, so as to not clutter up the Admin page? Does someone have a better solution?
Additionally, this is my first time contributing to a GitHub project. I’m familiar with git, but I would appreciate it if someone could help walk me through the process of forking/branching and submitting a pull request back to the master. Does Emoncms have a preferred workflow for this?
Thanks,
Joe