diff options
-rw-r--r-- | src/cmdline.opt | 6 | ||||
-rw-r--r-- | src/pies.c | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/cmdline.opt b/src/cmdline.opt index 5380b80..57f5b90 100644 --- a/src/cmdline.opt +++ b/src/cmdline.opt | |||
@@ -52,12 +52,18 @@ OPTION(foreground,,, | |||
52 | [<remain in foreground>]) | 52 | [<remain in foreground>]) |
53 | BEGIN | 53 | BEGIN |
54 | log_to_stderr_only = 1; | 54 | log_to_stderr_only = 1; |
55 | foreground = 1; | 55 | foreground = 1; |
56 | END | 56 | END |
57 | 57 | ||
58 | OPTION(no-init,,, | ||
59 | [<don't suppose SysV init mode if PID is 1>]) | ||
60 | BEGIN | ||
61 | /* handled separately */ | ||
62 | END | ||
63 | |||
58 | OPTION(inetd,i,, | 64 | OPTION(inetd,i,, |
59 | [<run in inetd mode>]) | 65 | [<run in inetd mode>]) |
60 | BEGIN | 66 | BEGIN |
61 | if (!instance) | 67 | if (!instance) |
62 | instance = "inetd"; | 68 | instance = "inetd"; |
63 | current_syntax = &config_syntax_tab[CONF_INETD]; | 69 | current_syntax = &config_syntax_tab[CONF_INETD]; |
@@ -2029,12 +2029,13 @@ int | |||
2029 | main (int argc, char **argv) | 2029 | main (int argc, char **argv) |
2030 | { | 2030 | { |
2031 | pid_t pid; | 2031 | pid_t pid; |
2032 | extern char **environ; | 2032 | extern char **environ; |
2033 | struct grecs_list_entry *ep; | 2033 | struct grecs_list_entry *ep; |
2034 | int diag_flags; | 2034 | int diag_flags; |
2035 | int i; | ||
2035 | 2036 | ||
2036 | set_program_name (argv[0]); | 2037 | set_program_name (argv[0]); |
2037 | #ifdef ENABLE_NLS | 2038 | #ifdef ENABLE_NLS |
2038 | setlocale (LC_ALL, ""); | 2039 | setlocale (LC_ALL, ""); |
2039 | bindtextdomain (PACKAGE, LOCALEDIR); | 2040 | bindtextdomain (PACKAGE, LOCALEDIR); |
2040 | textdomain (PACKAGE); | 2041 | textdomain (PACKAGE); |
@@ -2046,12 +2047,20 @@ main (int argc, char **argv) | |||
2046 | pies_master_argc = argc; | 2047 | pies_master_argc = argc; |
2047 | pies_master_argv = argv; | 2048 | pies_master_argv = argv; |
2048 | 2049 | ||
2049 | set_quoting_style (NULL, shell_quoting_style); | 2050 | set_quoting_style (NULL, shell_quoting_style); |
2050 | 2051 | ||
2051 | init_process = getpid () == 1; | 2052 | init_process = getpid () == 1; |
2053 | for (i = 1; i < argc; i++) | ||
2054 | { | ||
2055 | if (strcmp (argv[i], "--no-init") == 0) | ||
2056 | { | ||
2057 | init_process = 0; | ||
2058 | break; | ||
2059 | } | ||
2060 | } | ||
2052 | 2061 | ||
2053 | /* Set default logging */ | 2062 | /* Set default logging */ |
2054 | if (init_process) | 2063 | if (init_process) |
2055 | { | 2064 | { |
2056 | log_facility = LOG_DAEMON; | 2065 | log_facility = LOG_DAEMON; |
2057 | diag_flags = DIAG_TO_STDERR | DIAG_REOPEN_LOG; | 2066 | diag_flags = DIAG_TO_STDERR | DIAG_REOPEN_LOG; |