run: propagate return code/status from the child
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 29 Oct 2019 17:07:07 +0000 (18:07 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 19 Nov 2019 10:07:31 +0000 (11:07 +0100)
commitb06b7ace92c13ca02306a421cd3de195ec688753
treee1fb1321368ee46f5d5654de0fd41bd5ee449cbe
parent5db454b8031c58a743cc4ee3d5d1dd01dcff17e8
run: propagate return code/status from the child

Fixes #13756. We were returning things that didn't make much sense:
we would always use the exit_code value as the exit code. But it sometimes
contains a exit code from the process, and sometimes the number of a signal
that was used to kill the process. We would also ignore SuccessExitStatus=
and in general whether systemd thinks the service exited successfully
(hence the issue in #13756, where systemd would return success/SIGTERM,
but we'd just look at the SIGTERM part.)

If we are doing --wait, let's always propagate the exit code/status from
the child.

While at it, make the documentation useful.

(cherry picked from commit 7f3614e5479446bbd5a2bdf6aed4962e8d803e35)
man/systemd-run.xml
src/run/run.c