func ServiceActive(name string) (bool, error) {
	cmd := exec.Command("systemctl", "show", "-p", "ActiveState", name)
	out, err := cmd.CombinedOutput()
	if err != nil {
		return false, errors.New(err.Error() + ": output: " + string(out))
	}
	return strings.Contains(string(out), "ActiveState=active"), nil
}
ServiceLoaded returns whether or not the given systemd service has
ActiveState=active
package systemdstatus
import (
	"errors"
	"fmt"
	"github.com/CiscoCloud/distributive/tabular"
	"os/exec"
	"strings"
)
func ServiceLoaded(name string) (bool, error) {
	cmd := exec.Command("systemctl", "show", "-p", "LoadState", name)
	out, err := cmd.CombinedOutput()
	if err != nil {
		return false, errors.New(err.Error() + ": output: " + string(out))
	}
	return strings.Contains(string(out), "LoadState=loaded"), nil
}