Blob Blame History Raw
From 21a36b3b32ce384b686236a0193f0fb3440a8243 Mon Sep 17 00:00:00 2001
From: Randy Barlow <randy@electronsweatshop.com>
Date: Mon, 2 Jan 2017 22:40:27 -0500
Subject: [PATCH] Enable systemd notification if available.

This patch was originally written by Peter Lemenkov, and was
adapted for ejabberd 16.12.
---
 src/ejabberd_app.erl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/ejabberd_app.erl b/src/ejabberd_app.erl
index e4333c81..3ab6d4ba 100644
--- a/src/ejabberd_app.erl
+++ b/src/ejabberd_app.erl
@@ -77,6 +77,7 @@ start(normal, _Args) ->
     gen_mod:start_modules(),
     ejabberd_listener:start_listeners(),
     register_elixir_config_hooks(),
+    {module, sd_notify} == code:load_file(sd_notify) andalso sd_notify:sd_notify(0, "READY=1\nSTATUS=Initialized\nMAINPID=" ++ os:getpid() ++ "\n"),
     ?INFO_MSG("ejabberd ~s is started in the node ~p", [?VERSION, node()]),
     Sup;
 start(_, _) ->
-- 
2.11.0