systemctl: don't suppress error code when handling legacy commands
For legacy commands such as /sbin/halt or /sbin/poweroff we support legacy fallbacks that talk via traditional SysV way with PID 1 to issue the desired operation. We do this on any kind of error if the primary method of operation fails. When this is the case we suppress any error message that is normally generated, in order to not confuse the user. When suppressing this log message, don't suppress the original error code, because there's really no reason to.
This commit is contained in:
@@ -2693,10 +2693,9 @@ static int start_unit_one(
|
||||
if (r < 0) {
|
||||
const char *verb;
|
||||
|
||||
if (r == -ENOENT && arg_action != ACTION_SYSTEMCTL)
|
||||
/* There's always a fallback possible for
|
||||
* legacy actions. */
|
||||
return -EADDRNOTAVAIL;
|
||||
/* There's always a fallback possible for legacy actions. */
|
||||
if (arg_action != ACTION_SYSTEMCTL)
|
||||
return r;
|
||||
|
||||
verb = method_to_verb(method);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user