diff mbox

[3/4] nfs-server-generator: avoid using syslog

Message ID 148227955410.31345.7715529128389692817.stgit@noble (mailing list archive)
State New, archived
Headers show

Commit Message

NeilBrown Dec. 21, 2016, 12:19 a.m. UTC
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 <neilb@suse.com>
---
 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 mbox

Patch

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");