summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/nsswitch/winbindd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c
index 58b0f5943c..a937f06639 100644
--- a/source3/nsswitch/winbindd.c
+++ b/source3/nsswitch/winbindd.c
@@ -853,10 +853,8 @@ static void usage(void)
fstrcpy(global_myworkgroup, lp_workgroup());
- if (!interactive) {
+ if (!interactive)
become_daemon();
- pidfile_create("winbindd");
- }
#if HAVE_SETPGID
/*
@@ -891,6 +889,10 @@ static void usage(void)
return 1;
}
+ /* Only create the pidfile when we're ready to receive requests. */
+ if (!interactive)
+ pidfile_create("winbindd");
+
/* Loop waiting for requests */
process_loop(accept_sock);