From patchwork Thu Aug 3 22:04:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 9879925 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2108E60360 for ; Thu, 3 Aug 2017 22:04:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F4092896C for ; Thu, 3 Aug 2017 22:04:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0427F28972; Thu, 3 Aug 2017 22:04:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0C212896C for ; Thu, 3 Aug 2017 22:04:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751924AbdHCWEW (ORCPT ); Thu, 3 Aug 2017 18:04:22 -0400 Received: from quartz.orcorp.ca ([184.70.90.242]:60817 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751921AbdHCWET (ORCPT ); Thu, 3 Aug 2017 18:04:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=obsidianresearch.com; s=rsa1; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=mHwaMgQGpy1u9dj0UfWvWFJSOG8Xj5bE42JsG0b8gZo=; b=BxSty8VqvUmKQFglmEuuG+r9InbN8fYH2DH2Ibn0qx1wixKiV2jBVol+NjA+bP5yfXWJqi30BL7sSUgC+piR8tdtRMSYn2nehDXvM2cURVR7ssbQF1qbOzKJu1dM7w2cviNpZl5A2UfwPK1hs4enuGzqfZlgpK+7IYNU2v5c0hc=; Received: from [10.0.0.156] (helo=jggl.edm.orcorp.ca) by quartz.orcorp.ca with esmtps (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ddOE3-0004XK-8h; Thu, 03 Aug 2017 16:04:15 -0600 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Sean Hefty , Hal Rosenstock Subject: [PATCH rdma-core 4/4] ibacm: Use sd_notify to synchronize bootup Date: Thu, 3 Aug 2017 16:04:06 -0600 Message-Id: <1501797846-8228-5-git-send-email-jgunthorpe@obsidianresearch.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1501797846-8228-1-git-send-email-jgunthorpe@obsidianresearch.com> References: <1501797846-8228-1-git-send-email-jgunthorpe@obsidianresearch.com> X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.156 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- ibacm/ibacm.service.in | 1 + ibacm/src/acm.c | 3 +++ 2 files changed, 4 insertions(+) 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);