summaryrefslogtreecommitdiff
path: root/src/core/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 9588c625b2..6e3796f9dc 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -3096,6 +3096,9 @@ finish:
__lsan_do_leak_check();
#endif
+ if (r < 0)
+ (void) sd_notifyf(0, "ERRNO=%i", -r);
+
/* Try to invoke the shutdown binary unless we already failed.
* If we failed above, we want to freeze after finishing cleanup. */
if (arg_runtime_scope == RUNTIME_SCOPE_SYSTEM &&
@@ -3105,6 +3108,10 @@ finish:
error_message = "Failed to execute shutdown binary";
}
+ /* This is primarily useful when running systemd in a VM, as it provides the user running the VM with
+ * a mechanism to pick up systemd's exit status in the VM. */
+ (void) sd_notifyf(0, "EXIT_STATUS=%i", retval);
+
watchdog_free_device();
arg_watchdog_device = mfree(arg_watchdog_device);