Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp770639pxb; Thu, 17 Feb 2022 14:30:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJwsClkGTttXzvONTO32t7a3tvRornHegpGeign43m/OvV92XfH+lgGUhFHuRCS0vx/GqSVm X-Received: by 2002:a17:907:7704:b0:6cf:48ac:b4a8 with SMTP id kw4-20020a170907770400b006cf48acb4a8mr3974476ejc.305.1645137053023; Thu, 17 Feb 2022 14:30:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645137053; cv=none; d=google.com; s=arc-20160816; b=aqn2fzuYfwKMIlnogdh+1uHNTpRz9ZjI1Hy4pkaBeXACUJU4qoqaklmJ3QJAIUg6Ge 9VuD6IrWMNQMntzXu60pxUk8l4WmY7L26it8OVUurwie4kpt4lJ+gP6G5EUAXOI81VZl +IVzXviVhwkEXZJOGktzdByQG9fikZl9DkXfn0maIco6GG1aAUgX+8xU02/5U+x9Kpzr +w1PzA61xTDdxMY4kdXVpZHUaujweaOqhp0o8xI+UFVMZxKu0W/GIlp16RZ0sRE/TxVZ GnM0sB9UP/lGnWa2zHcw5yAh4es4rm+d0wPTrYdcNK4vhFCQxfoLM4Yo87KMp9jJzPsp irIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=TmIKPWLwLcaawvkdm7yJseCY+uW27uKUt+4FWk3PCxI=; b=IH907pxFepB0vp74ua1wn1bYnyZarHEjHpn5cvPBWTfjNs8aNFGfpTr94qFKI+2Swq H10nfMbqPOYb5PyLmbC4JXjuOZZPxAQqrqIxU5is7j+PotSpcXCNkITWQhW9glmAYtHb P6S2no20h8JwGD9em0yXoWZbU2FvmLF9neN4CO9S8fDD4AamMqpMxzZzfzZG2UZFRnzK oTmOEMLbh+LG4p8YHp4+Jl/UxqJ9nsUllIaWRdsqB0XR13VICryvKHChDM8JLHeaBHDD lzRETaUoYnDqJ7tZL40aJISxBPhTBrC9nUp3QAz+29eJU+7cvQMbuucv8aJGZ+a+4+oX NPAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g24si2474396ejh.496.2022.02.17.14.30.15; Thu, 17 Feb 2022 14:30:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240337AbiBQMRC (ORCPT + 99 others); Thu, 17 Feb 2022 07:17:02 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:33420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240339AbiBQMQ4 (ORCPT ); Thu, 17 Feb 2022 07:16:56 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A7C37E097 for ; Thu, 17 Feb 2022 04:16:42 -0800 (PST) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Jzv1107j9zbkYx for ; Thu, 17 Feb 2022 20:15:33 +0800 (CST) Received: from dggpemm500017.china.huawei.com (7.185.36.178) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 17 Feb 2022 20:16:40 +0800 Received: from huawei.com (10.175.101.6) by dggpemm500017.china.huawei.com (7.185.36.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 17 Feb 2022 20:16:39 +0800 From: Wenchao Hao To: CC: Zhiqiang Liu , , "Wenchao Hao" , Subject: [PATCH] idmapd: Fix error status when nfs-idmapd exits Date: Thu, 17 Feb 2022 20:27:32 -0500 Message-ID: <20220218012732.1549586-1-haowenchao@huawei.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500017.china.huawei.com (7.185.36.178) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_12_24, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org nfs-idmapd.service would report following error when stopped: Feb 17 07:32:05 fedora systemd[1]: Starting NFSv4 ID-name mapping service... Feb 17 07:32:05 fedora rpc.idmapd[1198]: Setting log level to 0 Feb 17 07:32:05 fedora systemd[1]: Started NFSv4 ID-name mapping service. Feb 17 07:32:11 fedora rpc.idmapd[1198]: exiting on signal 15 Feb 17 07:32:11 fedora systemd[1]: Stopping NFSv4 ID-name mapping service... Feb 17 07:32:11 fedora systemd[1]: nfs-idmapd.service: Main process exited, code=exited, status=1/FAILURE Feb 17 07:32:11 fedora systemd[1]: nfs-idmapd.service: Failed with result 'exit-code'. Feb 17 07:32:11 fedora systemd[1]: Stopped NFSv4 ID-name mapping service. commit 93e8f092(idmapd: Add graceful exit and resource cleanup) redirected SIGTERM, so when executing "systemctl stop nfs-idmapd", the main() of idmapd would running to tail to return, while it returned 1 which considered as error by systemd. So here just return 0 in main(). Signed-off-by: Wenchao Hao --- utils/idmapd/idmapd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c index e2c160e8..e79c124d 100644 --- a/utils/idmapd/idmapd.c +++ b/utils/idmapd/idmapd.c @@ -474,7 +474,7 @@ main(int argc, char **argv) event_free(svrdirev); event_base_free(evbase); - return 1; + return 0; } static void -- 2.32.0