aboutsummaryrefslogtreecommitdiff
path: root/src/pies.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pies.c')
-rw-r--r--src/pies.c44
1 files changed, 35 insertions, 9 deletions
diff --git a/src/pies.c b/src/pies.c
index 9466aa2..5c3d7e6 100644
--- a/src/pies.c
+++ b/src/pies.c
@@ -22,7 +22,7 @@
int preprocess_only; /* Preprocess config, do nothing more */
int lint_mode; /* Test configuration syntax and exit */
-int log_to_stderr_only; /* Use only stderr for logging */
+int log_to_stderr_only; /* Use only stderr for logging */
int log_facility = LOG_USER;
char *log_tag;
struct pies_privs pies_privs;
@@ -1816,9 +1816,13 @@ config_parse (char const *name)
{
struct grecs_node *node;
struct grecs_node *tree = grecs_parse (name);
- if (!tree)
- config_error ();
+ if (!tree)
+ {
+ config_error ();
+ return;
+ }
+
for (node = tree; node; node = node->next)
{
node = grecs_find_node (node, "identity-provider");
@@ -2305,7 +2309,8 @@ main (int argc, char **argv)
pid_t pid;
extern char **environ;
struct grecs_list_entry *ep;
-
+ int diag_flags;
+
set_program_name (argv[0]);
#ifdef ENABLE_NLS
setlocale (LC_ALL, "");
@@ -2322,14 +2327,29 @@ main (int argc, char **argv)
# warning "pies compiled with init emulation code"
if (!init_process)
{
- fprintf (stderr, "%s: to enable init emulation code,\n", program_name);
- fprintf (stderr, "%s: define environment variable INIT_EMU=<inittab>[:<pies_init_file>]\n", program_name);
init_process = getenv ("INIT_EMU") != NULL;
+ if (init_process)
+ fprintf (stderr, "%s: running in init emulation mode\n", program_name);
+ else
+ {
+ fprintf (stderr,
+ "%s: to enable init emulation code,\n", program_name);
+ fprintf (stderr,
+ "%s: define environment variable INIT_EMU=<inittab>[:<pies_init_file>]\n", program_name);
+ fprintf (stderr,
+ "%s: define variable INIT_FIFO=<pathname> to override the default FIFO name\n",
+ program_name);
+ }
}
#endif
/* Set default logging */
- diag_setup (DIAG_TO_SYSLOG | (stderr_closed_p () ? 0 : DIAG_TO_STDERR));
+ if (init_process)
+ diag_flags = DIAG_TO_STDERR;
+ else
+ diag_flags = DIAG_TO_SYSLOG | (stderr_closed_p () ? 0 : DIAG_TO_STDERR);
+
+ diag_setup (diag_flags);
config_init ();
if (init_process)
@@ -2342,6 +2362,10 @@ main (int argc, char **argv)
char *piesinit = strtok (NULL, ":");
add_config (CONF_INITTAB, inittab);
add_config (CONF_PIES, piesinit ? piesinit : "/etc/pies.init");
+
+ init_fifo = getenv ("INIT_FIFO");
+ if (!init_fifo)
+ init_fifo = "/tmp/initctl";
}
else
{
@@ -2517,9 +2541,11 @@ main (int argc, char **argv)
diag_setup (DIAG_TO_SYSLOG);
}
- ctl_open ();
if (!init_process)
- create_pidfile (pidfile);
+ {
+ ctl_open ();
+ create_pidfile (pidfile);
+ }
if (argv[0][0] != '/')
logmsg (LOG_NOTICE,

Return to:

Send suggestions and report system problems to the System administrator.