core: downgrade error message if command is prefixed with - and the command is not found

Fixes #5621
This commit is contained in:
Yu Watanabe 2017-04-03 15:38:33 +09:00
parent 88be0aa226
commit 4d8b0f0f7a

View file

@ -2989,6 +2989,14 @@ int exec_spawn(Unit *unit,
error_message),
"EXECUTABLE=%s", command->path,
NULL);
else if (r == -ENOENT && command->ignore)
log_struct_errno(LOG_INFO, r,
"MESSAGE_ID=" SD_MESSAGE_SPAWN_FAILED_STR,
LOG_UNIT_ID(unit),
LOG_UNIT_MESSAGE(unit, "Skipped spawning %s: %m",
command->path),
"EXECUTABLE=%s", command->path,
NULL);
else
log_struct_errno(LOG_ERR, r,
"MESSAGE_ID=" SD_MESSAGE_SPAWN_FAILED_STR,