                  case ARG_PERSONALITY:
  
                          arg_personality = personality_from_string(optarg);
-@@ -3840,6 +3848,14 @@ static int wait_for_container(pid_t pid, ContainerStatus *container) {
+@@ -3920,6 +3928,14 @@ static int wait_for_container(pid_t pid, ContainerStatus *container) {
          return r;
  }
  


[patch ported to v219 -alban]
[patch ported to git master 2015-05-20 -alban]
---
 src/nspawn/nspawn.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index a38f47d..869a864 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -190,6 +190,7 @@ static bool arg_quiet = false;

 static void nop_handler(int sig) {}
 
 static int on_orderly_shutdown(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata) {
@@ -4875,6 +4891,14 @@ int main(int argc, char *argv[]) {
                         goto finish;
                 }
 
+                if (arg_pid_file) {
+                        r = write_pid(arg_pid_file, pid);
+                        if (r < 0) {
+                                log_error_errno(r, "Failed to write pid file: %m");
+                                goto finish;
+                        }
+                }
+
                 sd_notifyf(false,
                            "READY=1\n"
                            "STATUS=Container running.\n"
-- 
2.4.1

