bootstrapper: use systemd dbus connection

This commit is contained in:
Malte Poll 2023-01-20 10:12:09 +01:00 committed by Malte Poll
parent 6f56ed69f8
commit f92a07821e

View File

@ -14,7 +14,7 @@ import (
) )
func startSystemdUnit(ctx context.Context, unit string) error { func startSystemdUnit(ctx context.Context, unit string) error {
conn, err := dbus.NewSystemdConnectionContext(ctx) conn, err := dbus.NewSystemConnectionContext(ctx)
if err != nil { if err != nil {
return fmt.Errorf("establishing systemd connection: %w", err) return fmt.Errorf("establishing systemd connection: %w", err)
} }
@ -38,7 +38,7 @@ func startSystemdUnit(ctx context.Context, unit string) error {
} }
func enableSystemdUnit(ctx context.Context, unitPath string) error { func enableSystemdUnit(ctx context.Context, unitPath string) error {
conn, err := dbus.NewSystemdConnectionContext(ctx) conn, err := dbus.NewSystemConnectionContext(ctx)
if err != nil { if err != nil {
return fmt.Errorf("establishing systemd connection: %w", err) return fmt.Errorf("establishing systemd connection: %w", err)
} }