summaryrefslogtreecommitdiff
path: root/src/shutdown/shutdown.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shutdown/shutdown.c')
-rw-r--r--src/shutdown/shutdown.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c
index a8248901ce..b1dac20c69 100644
--- a/src/shutdown/shutdown.c
+++ b/src/shutdown/shutdown.c
@@ -14,6 +14,8 @@
#include <sys/stat.h>
#include <unistd.h>
+#include "sd-daemon.h"
+
#include "alloc-util.h"
#include "async.h"
#include "binfmt-util.h"
@@ -570,6 +572,10 @@ int main(int argc, char *argv[]) {
if (!in_container)
sync_with_progress();
+ /* 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", arg_exit_code);
+
if (streq(arg_verb, "exit")) {
if (in_container) {
log_info("Exiting container.");