Blob Blame History Raw
From 7792016b3ec67a7feb97ec374cecfb70bc632f39 Mon Sep 17 00:00:00 2001
From: Randy Barlow <randy@electronsweatshop.com>
Date: Sun, 22 Oct 2017 12:17:34 -0400
Subject: [PATCH] Enable systemd notification if available.

This patch was originally written by Peter Lemenkov, and was
adapted for ejabberd 17.07.

Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
---
 src/ejabberd_app.erl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/ejabberd_app.erl b/src/ejabberd_app.erl
index b52450d2..0cd449cb 100644
--- a/src/ejabberd_app.erl
+++ b/src/ejabberd_app.erl
@@ -56,6 +56,7 @@ start(normal, _Args) ->
     case ejabberd_sup:start_link() of
 	{ok, SupPid} ->
 	    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"),
 	    {T2, _} = statistics(wall_clock),
 	    ?INFO_MSG("ejabberd ~s is started in the node ~p in ~.2fs",
 		      [?VERSION, node(), (T2-T1)/1000]),
-- 
2.14.2