diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-04-14 18:09:37 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-04-14 18:09:37 +0200 |
commit | 43da27568b55d664ef8abc9b125e54ec8674603e (patch) | |
tree | 4df765771a716626e524f23a76a502d77452d213 | |
parent | 965aabe043074edbeca06ee2083c06be731c939b (diff) | |
parent | 16b921ad1c847ba0754adc10d2d45b17973dcd19 (diff) | |
download | otp-43da27568b55d664ef8abc9b125e54ec8674603e.tar.gz otp-43da27568b55d664ef8abc9b125e54ec8674603e.tar.bz2 otp-43da27568b55d664ef8abc9b125e54ec8674603e.zip |
Merge branch 'binarin/erts/fix-epmd-systemd-notifications/PR-999/OTP-13493'
* binarin/erts/fix-epmd-systemd-notifications/PR-999/OTP-13493:
Don't send unasked for systemd notifications
-rw-r--r-- | erts/epmd/src/epmd.c | 6 | ||||
-rw-r--r-- | erts/epmd/src/epmd_srv.c | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/erts/epmd/src/epmd.c b/erts/epmd/src/epmd.c index b36f4ccd40..44e997e609 100644 --- a/erts/epmd/src/epmd.c +++ b/erts/epmd/src/epmd.c @@ -592,8 +592,10 @@ void epmd_cleanup_exit(EpmdVars *g, int exitval) free(g->argv); } #ifdef HAVE_SYSTEMD_DAEMON - sd_notifyf(0, "STATUS=Exited.\n" - "ERRNO=%i", exitval); + if (g->is_systemd){ + sd_notifyf(0, "STATUS=Exited.\n" + "ERRNO=%i", exitval); + } #endif /* HAVE_SYSTEMD_DAEMON */ exit(exitval); } diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c index 38ed137575..66c10a65bc 100644 --- a/erts/epmd/src/epmd_srv.c +++ b/erts/epmd/src/epmd_srv.c @@ -447,9 +447,11 @@ void run(EpmdVars *g) num_sockets = bound; #ifdef HAVE_SYSTEMD_DAEMON } - sd_notifyf(0, "READY=1\n" - "STATUS=Processing port mapping requests...\n" - "MAINPID=%lu", (unsigned long) getpid()); + if (g->is_systemd) { + sd_notifyf(0, "READY=1\n" + "STATUS=Processing port mapping requests...\n" + "MAINPID=%lu", (unsigned long) getpid()); + } #endif /* HAVE_SYSTEMD_DAEMON */ dbg_tty_printf(g,2,"entering the main select() loop"); |