Blame otp-0007-Added-systemd-notify-support-to-EPMD.patch

058573
From: Peter Lemenkov <lemenkov@gmail.com>
058573
Date: Fri, 6 Jun 2014 15:29:49 +0400
058573
Subject: [PATCH] Added systemd notify support to EPMD
058573
058573
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
058573
058573
Conflicts:
058573
	erts/configure.in
058573
058573
diff --git a/erts/epmd/src/epmd.c b/erts/epmd/src/epmd.c
885bb5
index 9630e0c..dff9bc6 100644
058573
--- a/erts/epmd/src/epmd.c
058573
+++ b/erts/epmd/src/epmd.c
885bb5
@@ -593,9 +593,11 @@ void epmd_cleanup_exit(EpmdVars *g, int exitval)
058573
       for(i=0; g->argv[i] != NULL; ++i)
058573
 	  free(g->argv[i]);
058573
       free(g->argv);
058573
-  }      
058573
-      
058573
-
058573
+  }
058573
+#ifdef HAVE_SYSTEMD_SD_DAEMON_H
058573
+  sd_notifyf(0, "STATUS=Exited.\n"
058573
+                "ERRNO=%i", exitval);
058573
+#endif // HAVE_SYSTEMD_SD_DAEMON_H
058573
   exit(exitval);
058573
 }
058573
 
058573
diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c
eeecf7
index 48fd7a5..18d898a 100644
058573
--- a/erts/epmd/src/epmd_srv.c
058573
+++ b/erts/epmd/src/epmd_srv.c
eeecf7
@@ -399,8 +399,11 @@ void run(EpmdVars *g)
058573
       }
058573
       select_fd_set(g, listensock[i]);
058573
     }
058573
-#ifdef HAVE_SYSTEMD_SD_DAEMON_H 
058573
+#ifdef HAVE_SYSTEMD_SD_DAEMON_H
058573
     }
058573
+    sd_notifyf(0, "READY=1\n"
058573
+                  "STATUS=Processing port mapping requests...\n"
058573
+                  "MAINPID=%lu", (unsigned long) getpid());
058573
 #endif
058573
 
058573
   dbg_tty_printf(g,2,"entering the main select() loop");