(serviceName string)
| 19 | return "systemd" |
| 20 | } |
| 21 | func (s *Systemd) IsActive(serviceName string) (bool, error) { |
| 22 | out, err := run(s.Client, s.toolCmd, "is-active", serviceName) |
| 23 | if err != nil && out != "inactive\n" { |
| 24 | if NewSnap().IsActive(serviceName) { |
| 25 | return true, nil |
| 26 | } |
| 27 | return false, err |
| 28 | } |
| 29 | return out == "active\n", nil |
| 30 | } |
| 31 | |
| 32 | func (s *Systemd) IsEnable(serviceName string) (bool, error) { |
| 33 | out, err := run(s.Client, s.toolCmd, "is-enabled", serviceName) |