@@ -4,6 +4,7 @@ rdma_sbin_executable(iwpmd
iwarp_pm_server.c
)
target_link_libraries(iwpmd LINK_PRIVATE
+ ${SYSTEMD_LIBRARIES}
${NL_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
@@ -32,6 +32,7 @@
*/
#include "config.h"
+#include <systemd/sd-daemon.h>
#include <getopt.h>
#include "iwarp_pm.h"
@@ -1447,6 +1448,10 @@ int main(int argc, char *argv[])
known_clients = init_iwpm_clients(&iwarp_clients[0]);
send_iwpm_mapinfo_request(netlink_sock, &iwarp_clients[0], known_clients);
+
+ if (systemd)
+ sd_notify(0, "READY=1");
+
iwarp_port_mapper(); /* start iwarp port mapper process */
free_iwpm_mapped_ports();
@@ -5,6 +5,7 @@ Requires=rdma-load-modules@iwpmd.service
After=network.target rdma-load-modules@iwpmd.service
[Service]
+Type=notify
ExecStart=@CMAKE_INSTALL_FULL_SBINDIR@/iwpmd --systemd
LimitNOFILE=102400
Tell systemd that iwpmd is ready once it established all threads and netlink sockets. This perhaps should be pushed a little later, after the message sent by send_iwpm_mapinfo_request is responded to by the kernel? Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> --- iwpmd/CMakeLists.txt | 1 + iwpmd/iwarp_pm_server.c | 5 +++++ iwpmd/iwpmd.service.in | 1 + 3 files changed, 7 insertions(+)