You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, for systemd init system such an approach doesn't work.
Status function of Kardianos Service project raises "systemctl is-active" call https://github.com/kardianos/service/blob/master/service_systemd_linux.go#L198
systemctl is-active would return "inactive" status for both stopped and non-existent service. So if the service has never been installed on the machine, Kardianos service.Status() would return Stopped.
It looks like
either Status() of Kardianos.Service in the case of SystemD should rely on "systemctl status" or "systemctl list-units"
or there should be some other way in Kardianos to check whether the service is installed
The text was updated successfully, but these errors were encountered:
One of the common ways to check whether the service is installed is getting its status and checking for error code
Unfortunately, for systemd init system such an approach doesn't work.
Status function of Kardianos Service project raises "systemctl is-active" call https://github.com/kardianos/service/blob/master/service_systemd_linux.go#L198
systemctl is-active would return "inactive" status for both stopped and non-existent service. So if the service has never been installed on the machine, Kardianos service.Status() would return Stopped.
It looks like
The text was updated successfully, but these errors were encountered: