From patchwork Mon May 15 22:47:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9728171 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 629DC60386 for ; Mon, 15 May 2017 22:48:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C23E288B0 for ; Mon, 15 May 2017 22:48:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40E1328915; Mon, 15 May 2017 22:48:04 +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 67E5628464 for ; Mon, 15 May 2017 22:48:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752361AbdEOWsA (ORCPT ); Mon, 15 May 2017 18:48:00 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:42797 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752345AbdEOWrv (ORCPT ); Mon, 15 May 2017 18:47:51 -0400 X-IronPort-AV: E=Sophos;i="5.38,346,1491235200"; d="scan'208";a="17886601" Received: from mail-by2nam01lp0178.outbound.protection.outlook.com (HELO NAM01-BY2-obe.outbound.protection.outlook.com) ([216.32.181.178]) by ob1.hgst.iphmx.com with ESMTP; 16 May 2017 06:47:46 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=X1MiakuJpfyyxIqIrkZ6TBofGAwKvpjH3nB2zG1c93M=; b=FVNTVljYofvyHajQbo4/LFFjuJcafZXIHr/nMNYZxRJKslUAVOik7upzsTTEcDT3dLwRxfGarhXTxFs/nhpUf6qqlY6NXDdJmGjrOz+OvEKai+MsUvXLR5GkLwOQZo7sm0KM2UWSCE6W0O8RkACHyqEZzTb21TGxBi0Y5PBeKXs= Received: from CO2PR04CA0096.namprd04.prod.outlook.com (10.165.94.150) by DM2PR0401MB0910.namprd04.prod.outlook.com (10.160.97.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16; Mon, 15 May 2017 22:47:44 +0000 Received: from CO1NAM04FT035.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::201) by CO2PR04CA0096.outlook.office365.com (2603:10b6:104:6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16 via Frontend Transport; Mon, 15 May 2017 22:47:44 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by CO1NAM04FT035.mail.protection.outlook.com (10.152.90.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1075.5 via Frontend Transport; Mon, 15 May 2017 22:47:43 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 9B.32.19026.E003A195; Mon, 15 May 2017 15:47:42 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Mon, 15 May 2017 15:47:37 -0700 X-AuditID: 0ac94371-41ba798000004a52-0d-591a300ed71c Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id D5.E3.11415.9003A195; Mon, 15 May 2017 15:47:37 -0700 (PDT) From: Bart Van Assche To: Doug Ledford CC: , Jason Gunthorpe , Leon Romanovsky , Bart Van Assche Subject: [PATCH rdma-core 5/5] srp_daemon.service: Add support for hot-plugging Date: Mon, 15 May 2017 15:47:33 -0700 Message-ID: <20170515224733.29586-12-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170515224733.29586-1-bart.vanassche@sandisk.com> References: <20170515224733.29586-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKLMWRmVeSWpSXmKPExsXCddJ5kS6fgVSkwbs32hYvz39gtfh+w9Ti ZN8/Zotnh3pZHFg8nk0/zOTxfUcvo8f7fVfZPD5vkgtgieKySUnNySxLLdK3S+DKWPfuD0vB cpeKC0s3sDUwnrfuYuTkkBAwkZjy9zRjFyMXh5DAUiaJmzM3sEE4Oxgl1u/Zzg5TtfjERKjE ZkaJ998PM4Mk2ASMJL69n8kCYosIqElserWIHaSIWWANo8SPLb/AuoUF/CU6L/4D2sHBwSKg KvH6fDZImFfAQaJx7gxGiAXyEme37ASbyQkU/3vzKRNIuZCAvcTP02ogIyUE2lglTl5YzAzR KyhxcuYTsL3MAhISB1+8AIsLCahLnFwyn2kCo9AsJGWzkJQtYGRaxSiWm5lTnJueWmBoolec mJeSWZytl5yfu4kREtiFOxhf3/Y+xCjAwajEw7tihWSkEGtiWXFl7iFGCQ5mJRFeDm6pSCHe lMTKqtSi/Pii0pzU4kOM0hwsSuK8WbJTI4QE0hNLUrNTUwtSi2CyTBycUg2MMTM9hPsW7576 aQJvw8lVvowfr7+LuZH4uEL936HkA1zp/tsMGu4ea7Lwr4gxCwz6vyRKRbNfcV28+Ixm+9rF qisPv319VOFzlMUW12f3MvdsulGn6ajRNOnjfen0ziIfdrEb9dukUjJFfJ6t2/T1n/GdA9pW YTfmvjc3YRHZ7GIeqnYqwz5GiaU4I9FQi7moOBEAjvOeFmgCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMJMWRmVeSWpSXmKPExsXCtZEjRZfTQCrSYN9EZouDP9sYLV6e/8Bq 8f2GqcXJvn/MFs8O9bI4sHo8m36YyeP7jl5Gj/f7rrJ5TFtznsnj8ya5ANYoLpuU1JzMstQi fbsErox17/6wFCx3qbiwdANbA+N56y5GTg4JAROJxScmsnUxcnEICWxklHi59T8LSIJNwEji 2/uZYLaIgJrEpleL2EFsZoE1jBIb94LFhQX8JTov/mPsYuTgYBFQlXh9PhskzCvgIDHz6Ekm iPnyEme37GQGsTmB4n9vPmUCKRcSsJf4eVptAiP3AkaGVYxiuZk5xbnpmQWGhnrFiXkpmcXZ esn5uZsYwcHAGbmD8elE80OMTBycUg2MAo4LJZ5JfPp15FY+f5xkb+QW8+TFk+8vbVjnscX+ beSMT1+eW8u4zDt1uizr8vaAWz8Zr7J7p+5OKtzg2r+l/vPGrzpml5ZtZ/1+bO2cFf4mAXPr 0rbk5jg12Mx5IbN5UnqG1r3P/a075r7zXB2w2fdV//INnLVvDfPXKxzU6GGzWZ4T+mmjrxJL cUaioRZzUXEiAMR4GAi2AQAA MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39400400002)(39850400002)(39410400002)(39840400002)(39450400003)(39860400002)(2980300002)(438002)(199003)(189002)(9170700003)(50986999)(54906002)(76176999)(50466002)(6666003)(36756003)(77096006)(72206003)(2950100002)(86362001)(8936002)(6916009)(356003)(110136004)(50226002)(5890100001)(5003940100001)(107886003)(38730400002)(81166006)(189998001)(47776003)(8676002)(4326008)(478600001)(5660300001)(305945005)(53936002)(1076002)(33646002)(2906002)(106466001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0401MB0910; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT035; 1:mczrgjIbTTiQvbkicB5eu34mQccfuvWlENLxa0M3DH9Dx4qAyHFdiGsgeoDWJeEhw88xa0D2qrQJb4ZK9Rq5J63pJ6b5EV7JcV1NXAaNYac4xKVdD7C6m/PUQiTaL7ss0XdA21Z16iqef+YbEjN2YE7ECFebCL5LF7FyuGn0imuB1K0flDEg6L88vVmGoylIdtnORuIgIkZR2j+mvFui2fg6kwl5MKS8C1WwBNGaYyKKBaCXuYwtw9IkQF/PUYoWGH5ZxjDrwsr/zxlOgsILAssBu21Lk/c7UT4KfxOMrF05HF2BWoGeBVkYpP02bCPN+VVc34X2oS74ug77QPJE0DtPwtK2kSok/6eJZGvqGGW9LZPeN2cRHi6r3UgLcspPvNtiiTUh0yVBeffD/mdSXgIlgAiebjX9JSAQiNRV7da+rg8OkJoOzzB4DFCn8sAMiHrzei1Dfyw6FTZZxNmeJw7we50md9Sxmzpixj6Xx5kyb6SnEQV94SjJicdRF45gJb5NjT/jgAcRa6AwXVXetA== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 582455bb-d018-4307-055e-08d49be46683 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:DM2PR0401MB0910; X-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rJv6tq3OfcVTSnHQ=; 31:ShEn5PJ2KaoPAPO/PW1mKKVGrUiUqhxzzmexENjzth3pP0//inGgR/cEpKloJZAjKlRUiHCESaQSdr2phcGvWb5AJeoPSGRFMKv+RkxLdPu7eGh57qZ6APAKCImyZ5Th/nlQwKzRYBOKx24gul2AjzZ4QsgmYEu9ixPCjPTT5JOWuBbkdA7DvzcvPInYKcYhjghDBJhdAN76Zs1x6dKRKgoPDxlE8J0Gl+bwMstyzS/7QNQ2Pkxz6n1PWqZHiGPXepZhf+GHbEyKsZOrOCA9Dg== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; DM2PR0401MB0910; 20:fxtsy7+khkeLBzB+IDQNsKNzk8THm68qffCrdY3wvYDmLTFbmyc3frlzipn0GQDTZ+JDYCjD4r8FU76vqD8SNuL5pn0Q/fUCSDTYwKGmQBduaa1LV55oQlwvSGC1PNB3dP+FslgQBY2h2lbQI+vtKHjW1Oo2zZU6u9xjVpyTfdXP1o1VPzdPxh/mHnYwarOZGHeFf8CI1Y8s18XKBJBsdVfvX16H/cZfX/J6fXPcnsN5mICJI4DONvYkFaOz3yFf+IjS/MQd4C5ExWyYQy1G3DlIaRNWdgxZxl/2jSAZVm2cqFE3Vo9x8HcA/CuQ06UESvrm6e8cKF+5FRKxeioVvNi/rjzHgiOOxMIYFV4qckONCdRee/vWjRyN92C/P6Yi9oeAs8fJeYE/of/Y3bewwOElohpVcG8Iu21O31PRQWZetxkMrjp3KceVD2+2WFb5YfqkVRxnt0g5NcJloEZZox4PMieHCgLlaGTf0RwZYC5bwaXC3N4pmOgU3ZlrrbXo X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(72170088055959)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13018025)(8121501046)(5005006)(13016025)(3002001)(93006095)(93004095)(10201501046)(6055026)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123558100)(20161123560025)(6072148); SRVR:DM2PR0401MB0910; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0401MB0910; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0401MB0910; 4:u0sAAwpqIxZGKlqYlwIjeAJzp3A+GBGPGUhPDipieCxzXhiFClVqCFztR8xaiWkkG4I8ZOTCN/PRIo8vghwBmPaCJwTXjdaULVSRkoq9FkcERvBz4+rscUlsAWrVGYrU0EPtBQ+7p4oTXEG/uEJl/4npy8tTQJ5Oy8E9v5N3DfeR8sx2FmozV923de0xiTN5HMEZv91pQd2bTjLm/rCou0JhhzmKNZ+5cF6BApKQTHxYf73Yi6bgoNvK6iRHf346k2rUafVGqsdJzoIGBVYU1DquCb8RdMYxw6Kz2rucWpfidJ+yJ6f7DCckjUsDJT+oiof9ZCxeZ3B4Q5UlKo/vAR1q+Eop4rxo1nPlWN7mTGtr248IUVY/hUiR6NTOVIxZ5Yj3GjHWoeX0UK7EAx2Ii3MXG5Ob+2MCy8uPBo8ZDVnQlw+PAmXs02GICasTjmMYokl7PvZnEAJRi2sp4vGiCRNo2SdMYnWHeMFk+rHNWbcesVSteA+85zggxjAnJ7pbFv9gFNZqtLFlDNGqRU2SZQjRy1K4OqSO7WZIWjeEmevYV5nKuD+lgzGwptJcvF/hroJcH7wJ+JFkX7aZUKmZ/l/UZWs5XrKZtnP/flJDy2Qb1RjLmxKtPPPhiChdB8tAWZUgIL8Nsv769kTT1QfnR6BP3yY+5Le+qjmb7IKdcFMnAOb/2tqUYeE05kib18ySbI9H+fYDtP0nT/eTnISH8Rng4UI0nrMMcyERuoRIxK9DZh4WIfcYk0F+hB2uDwCQaEa5LEhLMV0x0wLeaXRXjZ7gqRHsTk4HJ4+1UzgwrV7I8Lp9EsFZ2Q3rtKNaUBXBDaDBHj+9/7OZQ5jvrEtAX7wIAF43jN3RjBcDnwx0ToUPek5VH9tNuFADhIfAeiKUEJNGGVtBtgZ/cCzz5frs24cEA4WRVWouyvDqQOB8 h/s= X-Forefront-PRVS: 0308EE423E X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0401MB0910; 23:zUfXs61u7sD9GNzvux8w1a7tzoO4s9AvIW0fZ6N?= =?us-ascii?Q?4TBQ1HXxf3wzm+NcEKoD0Mc8YkuTI1vev8nZJ/ceKtMaad25wXMfePNRNGcQ?= =?us-ascii?Q?wppbXQbxj0JRZ8kos9+y8A7WK/hfCKsOydehfwByU4OFoaO+r+JYl6v+6TAU?= =?us-ascii?Q?8+nfqWBYA7RARCsQA37ayPWrVqFRrlMiql+QiBsJ8jq51N6ybJR0YLOV8cj/?= =?us-ascii?Q?kTGYpLBGkr4QlAi789Nx0rPsloS+o2f6yu3nPOrpuFaKPfB1DaUyTkT5QnL1?= =?us-ascii?Q?97V5vOf22zv9QT2gQ/IAGS8H0FYW6EzlImVDuWZIwDnix9mShMw/jmuERdjS?= =?us-ascii?Q?nAFf3pdN+lXkAappSY/R7Nrnbg1l6HhV6KercubgdljlXtPl07fFhDOslPtp?= =?us-ascii?Q?2sk/ZHIeg7rag+SjCQRU0rDI5bgvUTeGYkGLrpodIf5TYhykIr4za34TPGaD?= =?us-ascii?Q?6pvcHG2ze5TE3r9qPd5r5hdJ/RRNbk4/4985n4+GxxUVfgcQyfMu3tLydG8G?= =?us-ascii?Q?JGIG3NXDTRIQrtikcFU/IbfI20JkWr/hphYTwr6AFUjZtwou8YmcdQIpwvHr?= =?us-ascii?Q?8C6nxBdnpGA2VYJgjByaN66lExgogq/rJYCnXVY5uzB6UavLlG9Z9JDHLA9K?= =?us-ascii?Q?Drgpw4l5k50BpPZ1D2QIuWl7ImhOUwPZ0s9ohJMgLs8v3n3frugwDwX0gWAA?= =?us-ascii?Q?R/J2ihLjdIvaTvt1XNKsWmwSYTnKBTc/p0QKwgnKAGw3xXLB0CeUDgPHwcEo?= =?us-ascii?Q?/15DQPoVcgWAQDD8TA+nK2Q8axGYg2z3Ve3JIOm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G1Kkj+nmAp9CywmiIYGPRCHg41ufJPu937ulNoA81nyDVECTaH+VoY+9rqaEYpyyqecRdejWC2Q0csw1bAjBzeQcmovV1yyYT2Qw/ZA==; 24:LVg+X6hZ6qHA6LFVBk4eiQixQAiZkIdE9DKPgA37RukozYZSJ1rDRV8Myku28QFN9TLatGRlHsb150BEO46tOQBT4QNPRanm6mTeKvfp36c= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0401MB0910; 7:A4vWTaHG94pIuLtgeud8YekI28lyad4qZVIiCX8L39vE16zyC7yXZZFAvjVQn1ajYT5D1WzrQZupgA77Nf1w+4/dVIbRnThFgeYyF6cwQ2z0dy5PciU0c+p+UX1c1HtDjG4tT8krBPcDL7D1EkSNR6zJnMs9aK0Y5fU/znf39JhlfVFY1wm9nHnDJq/hrSf6LEv82sWFk88kOfhq+1uh8MfL89eWny7bxuwxhkFucKVXJfi7D5PSru8+9PPCqLsGAeqbw88tqr1HoyIyqMrI5yqo7TDkjBKkzVAfPVo3g6C/eHzpuPqfRNWTtQHtonkCeXOpCT7gz2DjY7mVjooEqA==; 20:ohmM/39wyXoeyk9HUIanSQjwEd6/y4hy5Ja6xhzvrkLlU3mgKtLX8vrw6F9BEMYfzYuCkNq04IvKkRFcOnA7llU8DUy1TRnNiq+WI/pkVEBTaRwXWCtEM09Gk4bFBsQXqiOZmXFRvqfwU668kwdY3UM9foXRABzgKcIWj1rqYM0= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2017 22:47:43.7981 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[63.163.107.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0401MB0910 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 srp_daemon.service is modified such that instead of starting /usr/sbin/srp_daemon.sh that it does not start any process. A new template service is added, namely srp_daemon_port@.service. This service replaces srp_daemon.sh and controls /usr/sbin/srp_daemon for a single port. A udev rule is added that instantiates the srp_daemon_port@.service every time an RDMA port is hot-added. Since the per-port service depends on the srp_daemon service, starting or stopping the srp_daemon service affects all per-port services. Signed-off-by: Bart Van Assche --- debian/srptools.install | 5 ++++ redhat/rdma-core.spec | 5 +++- srp_daemon/90-srp-daemon.rules | 1 + srp_daemon/CMakeLists.txt | 5 ++++ srp_daemon/srp_daemon.service | 12 ++++----- srp_daemon/srp_daemon.service.5 | 30 +++++++++++++++++++++++ srp_daemon/srp_daemon_port@.service | 18 ++++++++++++++ srp_daemon/srp_daemon_port@.service.5 | 46 +++++++++++++++++++++++++++++++++++ 8 files changed, 114 insertions(+), 8 deletions(-) create mode 100644 srp_daemon/90-srp-daemon.rules create mode 100644 srp_daemon/srp_daemon.service.5 create mode 100644 srp_daemon/srp_daemon_port@.service create mode 100644 srp_daemon/srp_daemon_port@.service.5 diff --git a/debian/srptools.install b/debian/srptools.install index ecec5d9a..81dbd4cd 100644 --- a/debian/srptools.install +++ b/debian/srptools.install @@ -1,6 +1,11 @@ etc/srp_daemon.conf +lib/systemd/system/srp_daemon.service +lib/systemd/system/srp_daemon_port@.service +lib/udev/rules.d/90-srp-daemon.rules usr/sbin/ibsrpdm usr/sbin/srp_daemon usr/share/doc/rdma-core/ibsrpdm.md usr/share/doc/srptools/ usr/share/man/man1/ibsrpdm.1 usr/share/man/man1/srp_daemon.1 +usr/share/man/man5/srp_daemon.service.5 +usr/share/man/man5/srp_daemon_port@.service.5 diff --git a/redhat/rdma-core.spec b/redhat/rdma-core.spec index 993a6c80..fc9edaa1 100644 --- a/redhat/rdma-core.spec +++ b/redhat/rdma-core.spec @@ -439,10 +439,13 @@ rm -rf %{buildroot}/%{_initrddir}/ %files -n srp_daemon %config(noreplace) %{_sysconfdir}/srp_daemon.conf %{_unitdir}/srp_daemon.service +%{_unitdir}/srp_daemon_port@.service %{_sbindir}/ibsrpdm %{_sbindir}/srp_daemon -%{_sbindir}/srp_daemon.sh %{_sbindir}/run_srp_daemon +%{_udevrulesdir}/90-srp-daemon.rules %{_mandir}/man1/ibsrpdm.1* %{_mandir}/man1/srp_daemon.1* +%{_mandir}/man5/srp_daemon.service.5* +%{_mandir}/man5/srp_daemon_port@.service.5* %doc %{_docdir}/%{name}-%{version}/ibsrpdm.md diff --git a/srp_daemon/90-srp-daemon.rules b/srp_daemon/90-srp-daemon.rules new file mode 100644 index 00000000..6d6788f0 --- /dev/null +++ b/srp_daemon/90-srp-daemon.rules @@ -0,0 +1 @@ +ACTION=="add", SUBSYSTEM=="infiniband_mad", PROGRAM:="/usr/bin/systemctl show srp_daemon -p UnitFileState", RESULT=="UnitFileState=enabled", TAG+="systemd", ENV{SYSTEMD_WANTS}+="srp_daemon_port@$attr{ibdev}:$attr{port}.service" diff --git a/srp_daemon/CMakeLists.txt b/srp_daemon/CMakeLists.txt index 24e4c30d..39f4bc99 100644 --- a/srp_daemon/CMakeLists.txt +++ b/srp_daemon/CMakeLists.txt @@ -3,6 +3,8 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NO_STRICT_ALIASING_FLAGS}") rdma_man_pages( ibsrpdm.1 srp_daemon.1.in + srp_daemon.service.5 + srp_daemon_port@.service.5 ) rdma_sbin_executable(srp_daemon @@ -28,6 +30,9 @@ rdma_subst_install(FILES "srp_daemon.sh.in" install(FILES srp_daemon.conf DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}") install(FILES srp_daemon.service DESTINATION "${CMAKE_INSTALL_SYSTEMD_SERVICEDIR}") +install(FILES srp_daemon_port@.service DESTINATION "${CMAKE_INSTALL_SYSTEMD_SERVICEDIR}") + +install(FILES 90-srp-daemon.rules DESTINATION "${CMAKE_INSTALL_UDEV_RULESDIR}") # FIXME: The ib init.d file should really be included in rdma-core as well. set(RDMA_SERVICE "openibd" CACHE STRING "init.d file service name to order srpd after") diff --git a/srp_daemon/srp_daemon.service b/srp_daemon/srp_daemon.service index 9510f5fb..5bcb1d53 100644 --- a/srp_daemon/srp_daemon.service +++ b/srp_daemon/srp_daemon.service @@ -1,17 +1,15 @@ [Unit] -Description=Start or stop the daemon that attaches to SRP devices +Description=Daemon that discovers and logs in to SRP target systems Documentation=man:srp_daemon file:/etc/rdma/rdma.conf file:/etc/srp_daemon.conf DefaultDependencies=false Conflicts=emergency.target emergency.service -Requires=rdma.service -Wants=opensm.service -After=rdma.service opensm.service -After=network.target Before=remote-fs-pre.target [Service] -Type=simple -ExecStart=/usr/sbin/srp_daemon.sh +Type=oneshot +RemainAfterExit=yes +ExecStart=/bin/true +ExecStop=/bin/true [Install] WantedBy=remote-fs-pre.target diff --git a/srp_daemon/srp_daemon.service.5 b/srp_daemon/srp_daemon.service.5 new file mode 100644 index 00000000..a6b25d6a --- /dev/null +++ b/srp_daemon/srp_daemon.service.5 @@ -0,0 +1,30 @@ +'\" t +.TH "SRP_DAEMON\&.SERVICE" "5" "" "srp_daemon" "srp_daemon.service" +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +srp_daemon.service \- srp_daemon systemd service that controls all ports +.SH "SYNOPSIS" +.PP +srp_daemon\&.service +.SH "DESCRIPTION" +.PP +The srp_daemon\&.service controls whether or not any srp_daemon processes are +running. Although no srp_daemon processes are controlled directly by the +srp_daemon\&.service, this service controls whether or not any +srp_daemon_port@\&.service are allowed to be active. Each +srp_daemon_port@\&.service controls one srp_daemon process. + +.SH "SEE ALSO" +.PP +\fBsrp_daemon\fR(1), +\fBsrp_daemon_port@.service\fR(5), +\fBsystemctl\fR(1) diff --git a/srp_daemon/srp_daemon_port@.service b/srp_daemon/srp_daemon_port@.service new file mode 100644 index 00000000..666400ab --- /dev/null +++ b/srp_daemon/srp_daemon_port@.service @@ -0,0 +1,18 @@ +[Unit] +Description=SRP daemon that monitors port %i +Documentation=man:srp_daemon file:/etc/rdma/rdma.conf file:/etc/srp_daemon.conf +DefaultDependencies=false +Conflicts=emergency.target emergency.service +Requires=rdma.service +Wants=opensm.service +After=rdma.service opensm.service srp_daemon.service +After=network.target +Before=remote-fs-pre.target +BindsTo=srp_daemon.service + +[Service] +Type=simple +ExecStart=/usr/sbin/srp_daemon -e -c -n -j %I -R 60 + +[Install] +WantedBy=remote-fs-pre.target diff --git a/srp_daemon/srp_daemon_port@.service.5 b/srp_daemon/srp_daemon_port@.service.5 new file mode 100644 index 00000000..a755b2eb --- /dev/null +++ b/srp_daemon/srp_daemon_port@.service.5 @@ -0,0 +1,46 @@ +'\" t +.TH "SRP_DAEMON_PORT@\&.SERVICE" "5" "" "srp_daemon" "srp_daemon_port@.service" +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +srp_daemon_port@.service \- srp_daemon_port@ systemd service that controls a +single port +.SH "SYNOPSIS" +.PP +srp_daemon_port@\&.service +.SH "DESCRIPTION" +.PP +The srp_daemon_port@\&.service controls whether or not an srp_daemon process +is monitoring the RDMA port specified as template argument. The format for the +RDMA port name is \fIdev:port\fR where \fIdev\fR is the name of an RDMA device +and \fIport\fR is an port number starting from one. Starting an instance of +this template will start an srp_daemon process. Stopping an instance of this +template will stop the srp_daemon process for the specified port. Here is an +example of how to obtain a list of all RDMA device and port number pairs: +.PP +.nf +.RS +$ for p in /sys/class/infiniband/*/ports/*; do + echo $p | sed 's,/sys/class/infiniband/,,;s,/ports/,:,' + done +mlx4_0:1 +mlx4_0:2 +mlx4_1:1 +mlx4_1:2 +.RE +.fi +.PP + +.SH "SEE ALSO" +.PP +\fBsrp_daemon\fR(1), +\fBsrp_daemon.service\fR(5), +\fBsystemctl\fR(1)