From patchwork Mon May 15 22:47:23 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: 9728157 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 0F9D060386 for ; Mon, 15 May 2017 22:47:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4F6328464 for ; Mon, 15 May 2017 22:47:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8D4B2885D; Mon, 15 May 2017 22:47:49 +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 1C74928464 for ; Mon, 15 May 2017 22:47:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752329AbdEOWrr (ORCPT ); Mon, 15 May 2017 18:47:47 -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 S1752322AbdEOWrp (ORCPT ); Mon, 15 May 2017 18:47:45 -0400 X-IronPort-AV: E=Sophos;i="5.38,346,1491235200"; d="scan'208";a="17886595" Received: from mail-sn1nam01lp0112.outbound.protection.outlook.com (HELO NAM01-SN1-obe.outbound.protection.outlook.com) ([207.46.163.112]) by ob1.hgst.iphmx.com with ESMTP; 16 May 2017 06:47:44 +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=OWWh5ybJECgdyDpIrPa1UsKG2OZsaewyNJ8raYe1V2U=; b=p08qcJulU0VM6u1BZO1ms75gVfIVbsXWN0zUAdNRTWCzELUuFUdQjnXxCMy30a+oLJYlRNQdmA/s0FUm669MfTtvWnoDzPoHGVjMMW0QDOvHgvpUxjxCPOUfZjJZlcexSvZBOR4G3lwzjEI6s6E9uV5/RTizGzld+mRN0FrodkA= Received: from CO2PR04CA0093.namprd04.prod.outlook.com (10.165.94.147) by BY2PR0401MB0903.namprd04.prod.outlook.com (10.160.64.14) 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:41 +0000 Received: from CO1NAM04FT024.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::201) by CO2PR04CA0093.outlook.office365.com (2603:10b6:104:6::19) 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:41 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by CO1NAM04FT024.mail.protection.outlook.com (10.152.90.105) 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:40 +0000 Received: from MILHUBIP04.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 85.E1.29323.9003A195; Mon, 15 May 2017 15:47:40 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Mon, 15 May 2017 15:47:37 -0700 X-AuditID: 0ac94369-1c3ff7000000728b-69-591a3008ee09 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 12.E3.11415.8003A195; Mon, 15 May 2017 15:47:36 -0700 (PDT) From: Bart Van Assche To: Doug Ledford CC: , Jason Gunthorpe , Leon Romanovsky , Bart Van Assche Subject: [PATCH rdma-core 1/5] srp_daemon.sh: Improve robustness Date: Mon, 15 May 2017 15:47:23 -0700 Message-ID: <20170515224733.29586-2-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+NgFrrGLMWRmVeSWpSXmKPExsXCddJ5kS6PgVSkwcSZ0hYvz39gtfh+w9Ti ZN8/Zotnh3pZHFg8nk0/zOTxfUcvo8f7fVfZPD5vkgtgieKySUnNySxLLdK3S+DKeHjlLnvB U+GKnvn/mBsYp/F3MXJySAiYSDx99pWti5GLQ0hgKZPEznud7BDODkaJjkcNTDBVq6atYYJI bGaUOL2wDyzBJmAk8e39TBYQW0RATWLTq0Vg3cwCaxglfmz5xQ6SEBZwkDhw6h8jiM0ioCox 8+0bsAZeAXuJd81b2SA2yEuc3bKTGcTmBKr/e/Mp0AIOoG32Ej9Pq4HMlBBoYpXYtPQYE0Sv oMTJmU/A5jALSEgcfPECrFdIQF3i5JL5TBMYhWYhKZuFpGwBI9MqRrHczJzi3PTUAkNTveLE vJTM4my95PzcTYyQ0M7cwXj3ifchRgEORiUe3hUrJCOFWBPLiitzDzFKcDArifBycEtFCvGm JFZWpRblxxeV5qQWH2KU5mBREuc9JzM1QkggPbEkNTs1tSC1CCbLxMEp1cDY4fc4pkTo2FwH TqFbDl4rFkzRM5u9/Wpz78d5V117Pe+lW7zc8viypIyq5E7WK8Ub7upWfezgEDmcbiditmJP HEPu5xyO7S9WdezYIqjM1RwrURGt9TBMOixR80DnnmLJ2Ze8tswTsXuYIP2m+aP14cWrfzSX CgS8mvJzz6/30g3N7Usl0hqUWIozEg21mIuKEwHl0pU3aQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEJMWRmVeSWpSXmKPExsXCtZEjRZfDQCrS4N86Q4uDP9sYLV6e/8Bq 8f2GqcXJvn/MFs8O9bI4sHo8m36YyeP7jl5Gj/f7rrJ5TFtznsnj8ya5ANYoLpuU1JzMstQi fbsEroyHV+6yFzwVruiZ/4+5gXEafxcjJ4eEgInEqmlrmEBsIYGNjBKfnvqD2GwCRhLf3s9k AbFFBNQkNr1axA5iMwusYZTYuBcsLizgIHHg1D9GEJtFQFVi5ts3QHEODl4Be4nJzYwQ4+Ul zm7ZyQxicwKV/735lAmkRAio5OdptQmM3AsYGVYxiuVm5hTnpmcWGBrqFSfmpWQWZ+sl5+du YgSHAmfkDsanE80PMTJxcEo1MMpqSz9/FjN3Uv7PsoS16tcjUy6GCG84V7xqk775OfEb++q9 mE7I7ln1PGXdCpN34gUqZi8E8l3er934P3PTJc8E/SRO1yP/zLr3q16U3p4e9Ilb/XzGsxKD SZb8ViyTTDaIH4x2e7DxGcuulblVWZvVrEpYF940uuLVceZI1PGL9sKnmB78MFFiKc5INNRi LipOBADPnYvYtQEAAA== MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39850400002)(39410400002)(39400400002)(39860400002)(39840400002)(39450400003)(2980300002)(438002)(199003)(189002)(9170700003)(50226002)(50986999)(8936002)(86362001)(575784001)(2950100002)(6916009)(1076002)(50466002)(77096006)(81166006)(8676002)(6666003)(110136004)(106466001)(305945005)(38730400002)(107886003)(76176999)(33646002)(54906002)(53936002)(5660300001)(478600001)(47776003)(356003)(2906002)(5003940100001)(36756003)(189998001)(4326008)(72206003); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR0401MB0903; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT024; 1:PI8nzOv4CMBbALh4nUCBqaQIWogZ82Yeh02+Q3EgDS08OwuI7/Sx0jb06N10kcbDH+8Mm4jtZbf4cV6Jte5ehDkVUZjLvcreBVAWXIpdkqhI86iQhfD/4O/iuCJO6G9qj/zIDiYXDeSSS05lTj9JO/veKgkym6aH2+gv5Eqh1wYp+QelY2zgRe8hDtmpZA5Ou9bNYP9LeDmq2W6vTjgSibjih3kEDm3lcw/OK2CxuMaDimFLR1kEiAeB+llQTGLxQcsExqV98U8s0JmTP3WMpD0lJPERT1XEx0aJZQDPUKSqchzQonY818ZV8kg8sXP8RBHDLljjw8ARtc/ANmE8g7ZdqqdjXFD3x0BbVKNH+bM9qYUDrDFIue+NmLTz2UhDCCmuL4v7pdQH1YYVu5bzGbn+VFahMNZpZENhm11ycD14GbTDaI7STuo+ORQu7cREDn2wLufJpYasXgu5rwwUlx72sKVI2pCTkzYXvG9vQO3LJFpK/OR1ycjjx2vE846ZP/zYGFvHuRtJh16SAXkUmfg6XGSdj62s4f+HMetKf5roXPGFXf3oTaneKnJApriN X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d5737194-1728-40cd-79d5-08d49be4649a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031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1gBC+TgCqtEAFaSqo9Odlmg44/EuCw=; 31:p/c+1JYU+8SpX4YmV4dKIgrX7nl2u/8JGnUpF7ifGERujAJuTU14xd8dj771Eetp+6dSjwEWedRM3qUs2IEbaSu42coTDHisoh5lgGUNAUAWRFF38ANWWe60n5TzZ1Ke3Mbf1DGDy4ZRjq54S8PD2WCZQV9XdE9w/E1/nhbAsyrNjFkmRrPo547ebfCpjy34stXUgVxBmUHnB0tUmkaIve3L6IB+C52dzvxFGXhDplHW3paCOmPn6SJB/LKGNkbF WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BY2PR0401MB0903; 20:ymqVkIzKZBtvClxAoocwmfJ+f233PedfV1xYqh8YG8YyAMk3jYmaoEM8IPMFYstv6EkVpqf1wYQAE5bwFB7IUaWLthvdjWK0diTGQhUfs6rC5BiX95zUgG52MM0aiu6JRA4JD4C9XrV90/EsiOeFA8zBnC8WGGk2Ai7Q9oxJMNjtIL+7uPzVHLP3a33rOjsMBulmguNspkDxUJX7DxLPs8leXK6hHxXrJphkEqf2UXXjjPGBhqp8KpBhcB/QYxEUxmjTf2e6sqXQpUE5ltbD+Jk3HVgD0G026cbGfuVSwALtKm4buvZsCYuAfmsweiS2kPNDZWadqUAE7F3al6GEFD1UoTcJIM9y7SkA5Kc/BGp3h7zq5m0SwY6Vfy8o3jgCB9MuHOqGEAkbGP1YM7AMyC/1U8Bx5uSaLqPkjx1G8isks9LVV/i7umc+4zv6OhkZfItH34f8FhVO6ES1PtWoCM4kvyyomeplagianbZwluP9ZPgWf1F1C7+ldyPM6cgO X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(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:BY2PR0401MB0903; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0401MB0903; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0401MB0903; 4:QesC33HfGKgR/dJu3rElMO7cSTlSz4S+3OPHguwup02wRTwZIbGsZBQ9WZIofHaSn+kVB8fSfPhz+ObuR2ACfTWv3oo0dJhrLRmw4sVxc1IkdnHvHKjO5Z8NBzm11AphEGiI9/lTu19pvupV30Ihfb/CUIDFnNuaZSLWlITua0k9Mz7QMoLTuF9odMw9yZJHjjbnOCqpFp2t9nGtYkGutDkd+3IWsfQhSmKjLLpuMTQsL/tCUmmGLoElXTRIVTV/2GEIUi0fDFMkvAOMWzH2hNHE6MphKZUBnCHIS6bn1nVn0K6ZvbDjxsA2dP1yY/Eixo6xL9mBy9E6ra4Sld8KMBxxrY9bW8+nhyQgvtNK2VlVQ1CXuvK3FJFHHXNiff/hc6yxNKMszoKNL1Jyo/9M2ybFn+viisPTfsNLWnM3v+IotXgwLh3LLQyQ3RWW88cZTI8+nh/k09rLiTnSRgZ63u8NivB0dvuIhmWf0q2TnHzE/fuIhvwumHDJpSCjKkZghPIh+/y0sJ6pdlKHQ+hXLvdgaSBrnp1Ab4S6jH6fDdHtabGar01IsJ0cxj2v6V4JQ61CYmXLRreFF0G1S7mgpUCaFNEmByPPnm8YH1A3e+5VeZSeedTwMpfud9bTC8J5rHcVct0nDXSt+fDGaf2LaxBqbRAgALlAbsSr8oh4gljWYRZe4Oo4mPhxbYJv5AUVPU46f1AZofcEHsZEXKq97uL47kmhgZ/+xPMzBxvwhJBFDSFDzxPL4zpkwCuBubRbp+yZFSr7oP5pS5JGwCtHM500y4UZ6LROM3eCZFCaldWXu85ELjbmMUppeFQEpPQmyNScjmg2VowUEA+IxL8VfDWmDkshkj9Y6dlF85tBnatC8Ea5gMQt6KpM/qZNICmf X-Forefront-PRVS: 0308EE423E X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0401MB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nXBsCBbpeq6wSZKNQ0KO7agJlQgb+3LLUwEp3eeC09DCeIUn/rx2F/MRixg3CQOWf1NGrBYz1BjPFEEm8N8x8uY5UfsmiaxJjk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0401MB0903; 7:CuAPWgeiNHyWHiCXc2wPcvF/TN28ne9ffntQYbL39tQA5U2+qaoNUONUy9rwCc0SBhr3gCI2eHpZVltKt8e2kRO8+VL7dDQDI3SjHmyPG74qcHOw+HzMqTLRJBxS8qqzhHmjDejPcAuPGBBQqu6neVaOAybnpaDFoRt7wqsHKyE00m/OfAQg9kJB6X62kH+id3uuIDr4fDVtswwi4tZ4WTNVMjHhAekOCbGVvVdV4Q6Tmpu5xLxcbs5fAXwcw3YfhY5xcX2TNPkzYinvk/DRfoKwAbxkBvMOKCymUFfbBf8i3L7OgMGYc5W70FxiVKZzAF06Q+9O8UMes3aw8NJhpw==; 20:T+pyRplSNdUl5NJZq/sUoC+ljAk3ck2MXvRU8BQQU314B/AJNNVYDhZ9VjktULpbdaGJjfMn36YaPqjuNih9EZlSxcWa6vRZaDc2Vg5kZ8vyj3Lz91kqMmYM/ndSIPw0xdkVNPB37OEqh12M3KlgPv9LRefGxPbLV9djFO4BOlY= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2017 22:47:40.6120 (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.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0401MB0903 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 Surround expansions of shell variables that can contain spaces with double quotes. Use arrays instead of a space-separated strings to store lists to avoid that strings that contain whitespace get split when iterating over a list. Signed-off-by: Bart Van Assche --- srp_daemon/srp_daemon.sh.in | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/srp_daemon/srp_daemon.sh.in b/srp_daemon/srp_daemon.sh.in index cb0b81ef..75e8a31b 100755 --- a/srp_daemon/srp_daemon.sh.in +++ b/srp_daemon/srp_daemon.sh.in @@ -31,35 +31,35 @@ shopt -s nullglob prog=@CMAKE_INSTALL_FULL_SBINDIR@/srp_daemon -params=$@ +params=("$@") ibdir="/sys/class/infiniband" rescan_interval=60 -pids="" -pidfile=@CMAKE_INSTALL_FULL_RUNDIR@/srp_daemon.sh.pid +pids=() +pidfile="@CMAKE_INSTALL_FULL_RUNDIR@/srp_daemon.sh.pid" mypid=$$ trap_handler() { - if [ -n "$pids" ]; then - kill -15 $pids > /dev/null 2>&1 - wait $pids + if [ "${#pids[@]}" ]; then + kill -15 "${pids[@]}" > /dev/null 2>&1 + wait "${pids[@]}" fi - logger -i -t "$(basename $0)" "killing $prog." - /bin/rm -f $pidfile + logger -i -t "$(basename "$0")" "killing $prog." + /bin/rm -f "$pidfile" exit 0 } # Check if there is another copy running of srp_daemon.sh -if [ -f $pidfile ]; then - if [ -e /proc/$(cat $pidfile 2>/dev/null)/status ]; then - echo "$(basename $0) is already running. Exiting." +if [ -f "$pidfile" ]; then + if [ -e "/proc/$(cat "$pidfile" 2>/dev/null)/status" ]; then + echo "$(basename "$0") is already running. Exiting." exit 1 else - /bin/rm -f $pidfile + /bin/rm -f "$pidfile" fi fi -if ! echo $mypid > $pidfile; then +if ! echo $mypid > "$pidfile"; then echo "Creating $pidfile for pid $mypid failed" exit 1 fi @@ -72,12 +72,12 @@ do done for d in ${ibdir}_mad/umad*; do - hca_id="$(<$d/ibdev)" - port="$(<$d/port)" + hca_id="$(<"$d/ibdev")" + port="$(<"$d/port")" add_target="${ibdir}_srp/srp-${hca_id}-${port}/add_target" if [ -e "${add_target}" ]; then - ${prog} -e -c -n -i ${hca_id} -p ${port} -R ${rescan_interval} ${params} >/dev/null 2>&1 & - pids="$pids $!" + ${prog} -e -c -n -i "${hca_id}" -p "${port}" -R "${rescan_interval}" "${params[@]}" >/dev/null 2>&1 & + pids+=($!) fi done