From patchwork Tue Jan 8 08:34:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 10751545 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0011A13B5 for ; Tue, 8 Jan 2019 08:34:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD38528B7C for ; Tue, 8 Jan 2019 08:34:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CEA0428B7E; Tue, 8 Jan 2019 08:34:33 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C46D228B7C for ; Tue, 8 Jan 2019 08:34:32 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6D84E211A43D1; Tue, 8 Jan 2019 00:34:32 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=195.135.220.15; helo=mx1.suse.de; envelope-from=jthumshirn@suse.de; receiver=linux-nvdimm@lists.01.org Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 87B8321B02822 for ; Tue, 8 Jan 2019 00:34:30 -0800 (PST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 59673AD8A; Tue, 8 Jan 2019 08:34:28 +0000 (UTC) From: Johannes Thumshirn To: Dan Williams Subject: [PATCH] ndctl, monitor: use type=simple instead of type=forking Date: Tue, 8 Jan 2019 09:34:23 +0100 Message-Id: <20190108083423.6996-1-jthumshirn@suse.de> X-Mailer: git-send-email 2.16.4 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux NV-DIMM Mailing List MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP There is no need to use Type=forking for 'ndctl monitor', Type=simple is sufficient. When we use Type=forking and try to run ndctl monitor on a machine without pmem we even get the following error in the journal: Jan 07 13:34:54 bragi systemd[1]: Starting Ndctl Monitor Daemon... Jan 07 13:34:54 bragi ndctl[13776]: custom logging function 0x55ea57d60250 registered Jan 07 13:34:54 bragi systemd[1]: Started Ndctl Monitor Daemon. Jan 07 13:34:54 bragi ndctl[13777]: ndctl monitor daemon started Jan 07 13:34:54 bragi kill[13778]: kill: cannot find process "" Jan 07 13:34:54 bragi systemd[1]: ndctl-monitor.service: Control process exited, code=exited status=1 Jan 07 13:34:54 bragi systemd[1]: ndctl-monitor.service: Unit entered failed state. Jan 07 13:34:54 bragi systemd[1]: ndctl-monitor.service: Failed with result 'exit-code'. This is because the daemon exits and systemd is not able to determine $MAINPID anymore. Signed-off-by: Johannes Thumshirn Reviewed-by: Dan Williams --- ndctl/ndctl-monitor.service | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ndctl/ndctl-monitor.service b/ndctl/ndctl-monitor.service index 342a1b1972d5..eeedbd30bb42 100644 --- a/ndctl/ndctl-monitor.service +++ b/ndctl/ndctl-monitor.service @@ -2,9 +2,8 @@ Description=Ndctl Monitor Daemon [Service] -Type=forking -ExecStart=/usr/bin/ndctl monitor --daemon -ExecStop=/bin/kill ${MAINPID} +Type=simple +ExecStart=/usr/bin/ndctl monitor [Install] WantedBy=multi-user.target