summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-09-17 20:47:59 +0000
committerJeremy Allison <jra@samba.org>2002-09-17 20:47:59 +0000
commitfa184ea1699fb5aebdc2eb0f3ca4e02749201729 (patch)
tree3330232546ce19158cf5563310a5c2e60bb81ec3 /source3/nsswitch/winbindd.c
parent9bab1d0c1a51a7532da0c55a59cf5a91b8ab6a3d (diff)
downloadsamba-fa184ea1699fb5aebdc2eb0f3ca4e02749201729.tar.gz
samba-fa184ea1699fb5aebdc2eb0f3ca4e02749201729.tar.bz2
samba-fa184ea1699fb5aebdc2eb0f3ca4e02749201729.zip
Only create the pidfile once we're ready to receive requests.
This allows external programs to correctly synchronise with us. Jeremy. (This used to be commit ffb7632d05191342ecfc5f78fbfd7beacfe257ad)
Diffstat (limited to 'source3/nsswitch/winbindd.c')
-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);