summaryrefslogtreecommitdiff
path: root/source3/smbd/server.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-03-21 13:16:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:39 -0500
commit250c02554ec3dd52f33e33406fdd605f5d932d5f (patch)
tree76eb06dfc3b575016dc430575495d599d08421b8 /source3/smbd/server.c
parent22183b0c7419e91809d1460a4616066d5ec27d19 (diff)
downloadsamba-250c02554ec3dd52f33e33406fdd605f5d932d5f.tar.gz
samba-250c02554ec3dd52f33e33406fdd605f5d932d5f.tar.bz2
samba-250c02554ec3dd52f33e33406fdd605f5d932d5f.zip
r14618: add --no-process-group to all server programms
to make the following possible: timelimit 20000 bin/nmbd -F -S --no-process-group timelimit 20000 bin/smbd -F -S --no-process-group this is needed to 'make test' working without losing child processes metze (This used to be commit c3a9f30e2a12cc852c9fa3a7d161f5c6ee0694ce)
Diffstat (limited to 'source3/smbd/server.c')
-rw-r--r--source3/smbd/server.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 2e96b4ceb9..46ab191530 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -715,6 +715,7 @@ void build_options(BOOL screen);
static BOOL is_daemon = False;
static BOOL interactive = False;
static BOOL Fork = True;
+ static BOOL no_process_group = False;
static BOOL log_stdout = False;
static char *ports = NULL;
int opt;
@@ -725,6 +726,7 @@ void build_options(BOOL screen);
{"daemon", 'D', POPT_ARG_VAL, &is_daemon, True, "Become a daemon (default)" },
{"interactive", 'i', POPT_ARG_VAL, &interactive, True, "Run interactive (not a daemon)"},
{"foreground", 'F', POPT_ARG_VAL, &Fork, False, "Run daemon in foreground (for daemontools & etc)" },
+ {"no-process-group", 0, POPT_ARG_VAL, &no_process_group, True, "Don't create a new process group" },
{"log-stdout", 'S', POPT_ARG_VAL, &log_stdout, True, "Log to stdout" },
{"build-options", 'b', POPT_ARG_NONE, NULL, 'b', "Print build options" },
{"port", 'p', POPT_ARG_STRING, &ports, 0, "Listen on the specified ports"},
@@ -865,7 +867,7 @@ void build_options(BOOL screen);
if (is_daemon && !interactive) {
DEBUG( 3, ( "Becoming a daemon.\n" ) );
- become_daemon(Fork);
+ become_daemon(Fork, no_process_group);
}
#if HAVE_SETPGID
@@ -873,8 +875,9 @@ void build_options(BOOL screen);
* If we're interactive we want to set our own process group for
* signal management.
*/
- if (interactive)
+ if (interactive && !no_process_group) {
setpgid( (pid_t)0, (pid_t)0);
+ }
#endif
if (!directory_exist(lp_lockdir(), NULL))