Skip to content

Commit c8a2907

Browse files
Remove redundant helper methods
Signed-off-by: Kate Goldenring <[email protected]>
1 parent 4ddb0a1 commit c8a2907

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

internal/containerd/install_dbus.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,8 @@ package containerd
33
import (
44
"fmt"
55
"log/slog"
6-
"os"
7-
"os/exec"
86
)
97

10-
// UsesSystemd checks if the system is using systemd.
11-
func UsesSystemd() bool {
12-
cmd := nsenterCmd("systemctl", "list-units", "|", "grep", "-q", "containerd.service")
13-
if err := cmd.Run(); err != nil {
14-
slog.Info("Error with systemctl: %w\n", "error", err)
15-
return false
16-
}
17-
return true
18-
}
19-
208
// InstallDbus checks if D-Bus service is installed and active. If not, installs D-Bus
219
// and starts the service.
2210
// NOTE: this limits support to systems using systemctl to manage systemd.
@@ -63,8 +51,3 @@ func InstallDbus() error {
6351

6452
return nil
6553
}
66-
67-
func nsenterCmd(cmd ...string) *exec.Cmd {
68-
return exec.Command("nsenter",
69-
append([]string{fmt.Sprintf("-m/%s/proc/1/ns/mnt", os.Getenv("HOST_ROOT")), "--"}, cmd...)...) // #nosec G204
70-
}

0 commit comments

Comments
 (0)