Skip to content

Commit

Permalink
systemd: Improve message when sudo is used
Browse files Browse the repository at this point in the history
  • Loading branch information
cfergeau committed Sep 2, 2020
1 parent b275a70 commit a134d84
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/crc/systemd/systemd.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (c Commander) Status(name string) (states.State, error) {
}

func (c Commander) DaemonReload() error {
stdOut, stdErr, err := c.commandRunner.RunPrivileged("execute systemctl daemon-reload command", "systemctl", "daemon-reload")
stdOut, stdErr, err := c.commandRunner.RunPrivileged("executing systemctl daemon-reload command", "systemctl", "daemon-reload")
if err != nil {
return fmt.Errorf("Executing systemctl daemon-reload failed: %s %v: %s", stdOut, err, stdErr)
}
Expand All @@ -77,7 +77,8 @@ func (c Commander) service(name string, action actions.Action) (states.State, er
err error
)
if action.IsPriviledged() {
stdOut, stdErr, err = c.commandRunner.RunPrivileged("execute systemctl command", "systemctl", action.String(), name)
msg := fmt.Sprintf("execute systemctl %s %s", action.String(), name)
stdOut, stdErr, err = c.commandRunner.RunPrivileged(msg, "systemctl", action.String(), name)
} else {
stdOut, stdErr, err = c.commandRunner.Run("systemctl", action.String(), name)
}
Expand Down

0 comments on commit a134d84

Please sign in to comment.