summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-01-03 17:39:30 +0000
committerGerald Carter <jerry@samba.org>2003-01-03 17:39:30 +0000
commitf5d5df9644abc08ae1b16a0826eb8cf5c3de54d1 (patch)
tree1a8219ffe84022f095ea553da990226c9de49514 /source3/nsswitch/winbindd.c
parent6985578f5b7b83fc4896ae7316ce1a244e8f9a2d (diff)
downloadsamba-f5d5df9644abc08ae1b16a0826eb8cf5c3de54d1.tar.gz
samba-f5d5df9644abc08ae1b16a0826eb8cf5c3de54d1.tar.bz2
samba-f5d5df9644abc08ae1b16a0826eb8cf5c3de54d1.zip
patch to include support for daemontools from Michael Handler
(This used to be commit a8db1b611d83bfd8dcf60f1e6d8fcbf57c798528)
Diffstat (limited to 'source3/nsswitch/winbindd.c')
-rw-r--r--source3/nsswitch/winbindd.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c
index acc717e13c..479b35da07 100644
--- a/source3/nsswitch/winbindd.c
+++ b/source3/nsswitch/winbindd.c
@@ -758,6 +758,8 @@ struct winbindd_state server_state; /* Server state information */
static void usage(void)
{
printf("Usage: winbindd [options]\n");
+ printf("\t-F daemon in foreground mode\n");
+ printf("\t-S log to stdout\n");
printf("\t-i interactive mode\n");
printf("\t-B dual daemon mode\n");
printf("\t-n disable cacheing\n");
@@ -771,6 +773,8 @@ static void usage(void)
extern BOOL AllowDebugChange;
pstring logfile;
BOOL interactive = False;
+ BOOL Fork = True;
+ BOOL log_stdout = False;
int opt;
/* glibc (?) likes to print "User defined signal 1" and exit if a
@@ -795,12 +799,20 @@ static void usage(void)
/* Initialise samba/rpc client stuff */
- while ((opt = getopt(argc, argv, "id:s:nhB")) != EOF) {
+ while ((opt = getopt(argc, argv, "FSid:s:nhB")) != EOF) {
switch (opt) {
+ case 'F':
+ Fork = False;
+ break;
+ case 'S':
+ log_stdout = True;
+ break;
/* Don't become a daemon */
case 'i':
interactive = True;
+ log_stdout = True;
+ Fork = False;
break;
/* dual daemon system */
@@ -834,9 +846,15 @@ static void usage(void)
}
}
+ if (log_stdout && Fork) {
+ printf("Can't log to stdout (-S) unless daemon is in foreground +(-F) or interactive (-i)\n");
+ usage();
+ exit(1);
+ }
+
snprintf(logfile, sizeof(logfile), "%s/log.winbindd", dyn_LOGFILEBASE);
lp_set_logfile(logfile);
- setup_logging("winbindd", interactive);
+ setup_logging("winbindd", log_stdout);
reopen_logs();
DEBUG(1, ("winbindd version %s started.\n", VERSION ) );
@@ -853,7 +871,7 @@ static void usage(void)
exit(1);
if (!interactive) {
- become_daemon();
+ become_daemon(Fork);
pidfile_create("winbindd");
}