diff mbox

[rdma-core,4/4] ibacm: Use sd_notify to synchronize bootup

Message ID 1501797846-8228-5-git-send-email-jgunthorpe@obsidianresearch.com (mailing list archive)
State Accepted
Headers show

Commit Message

Jason Gunthorpe Aug. 3, 2017, 10:04 p.m. UTC
Tell systemd that ibacm is ready once the RDMA_NL_GROUP_LS socket is
opened. This is the point where ibacm is able to respond to kernel and
user queries for paths.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
 ibacm/ibacm.service.in | 1 +
 ibacm/src/acm.c        | 3 +++
 2 files changed, 4 insertions(+)
diff mbox

Patch

diff --git a/ibacm/ibacm.service.in b/ibacm/ibacm.service.in
index 7f31ba673da979..88fb751c7f0d76 100644
--- a/ibacm/ibacm.service.in
+++ b/ibacm/ibacm.service.in
@@ -5,6 +5,7 @@  After=opensm.service
 Wants=ibacm.socket
 
 [Service]
+Type=notify
 ExecStart=@CMAKE_INSTALL_FULL_SBINDIR@/ibacm --systemd
 
 [Install]
diff --git a/ibacm/src/acm.c b/ibacm/src/acm.c
index 3f28f04d8777b9..aba0deaa6de37f 100644
--- a/ibacm/src/acm.c
+++ b/ibacm/src/acm.c
@@ -1721,6 +1721,9 @@  static void acm_server(bool systemd)
 	if (ret)
 		acm_log(1, "Warn - Netlink init failed\n");
 
+	if (systemd)
+		sd_notify(0, "READY=1");
+
 	while (1) {
 		n = (int) listen_socket;
 		FD_ZERO(&readfds);