(ctx context.Context, args ...string)
| 78 | } |
| 79 | |
| 80 | func (s *Systemd) systemctl(ctx context.Context, args ...string) error { |
| 81 | cmd := exec.CommandContext(ctx, "systemctl", args...) |
| 82 | cmd.Stdout = os.Stdout |
| 83 | cmd.Stderr = os.Stderr |
| 84 | if err := cmd.Run(); err != nil { |
| 85 | return fmt.Errorf("systemctl %s: %w", args[0], err) |
| 86 | } |
| 87 | return nil |
| 88 | } |
| 89 | |
| 90 | func (s *Systemd) unitFilePath(name string) string { |
| 91 | return filepath.Join(systemdUnitDir, name+".service") |
no test coverage detected