From patchwork Wed Dec 21 00:19:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 9482407 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 9133B601C0 for ; Wed, 21 Dec 2016 00:20:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82A63283E8 for ; Wed, 21 Dec 2016 00:20:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 77A02284AE; Wed, 21 Dec 2016 00:20:22 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 4448E283F0 for ; Wed, 21 Dec 2016 00:20:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753356AbcLUAUQ (ORCPT ); Tue, 20 Dec 2016 19:20:16 -0500 Received: from mx2.suse.de ([195.135.220.15]:44882 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752273AbcLUAUQ (ORCPT ); Tue, 20 Dec 2016 19:20:16 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id F218CABD3; Wed, 21 Dec 2016 00:20:14 +0000 (UTC) From: NeilBrown To: Steve Dickson Date: Wed, 21 Dec 2016 11:19:14 +1100 Subject: [PATCH 3/4] nfs-server-generator: avoid using syslog Cc: linux-nfs@vger.kernel.org, "J. Bruce Fields" Message-ID: <148227955410.31345.7715529128389692817.stgit@noble> In-Reply-To: <148227940052.31345.1974080582264239934.stgit@noble> References: <148227940052.31345.1974080582264239934.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP nfs-server-generator is run very early when a lot of services are not yet started, so it mustn't depend on them. It already avoids using DNS, but it should avoid syslog too. If it tries to log error to syslog, it can deadlock. So just let messages go to stderr. Signed-off-by: NeilBrown --- systemd/nfs-server-generator.c | 3 +++ 1 file changed, 3 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/systemd/nfs-server-generator.c b/systemd/nfs-server-generator.c index 7c40b3f29b99..cc99969e9922 100644 --- a/systemd/nfs-server-generator.c +++ b/systemd/nfs-server-generator.c @@ -95,6 +95,9 @@ int main(int argc, char *argv[]) FILE *f, *fstab; struct mntent *mnt; + /* Avoid using any external services */ + xlog_syslog(0); + if (argc != 4 || argv[1][0] != '/') { fprintf(stderr, "nfs-server-generator: create systemd dependencies for nfs-server\n"); fprintf(stderr, "Usage: normal-dir early-dir late-dir\n");