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