aboutsummaryrefslogtreecommitdiff
path: root/src/pies.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pies.c')
-rw-r--r--src/pies.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/pies.c b/src/pies.c
index 875684a..09f9fab 100644
--- a/src/pies.c
+++ b/src/pies.c
@@ -58,4 +58,9 @@ char *mailer_command_line = "/usr/sbin/sendmail -oi -t";
int mailer_argc;
char **mailer_argv;
+
+char *default_control_url[2] = {
+ DEFAULT_PIES_CONTROL_URL,
+ DEFAULT_INIT_CONTROL_URL
+};
struct config_file
@@ -1750,4 +1755,16 @@ config_parse (char const *name)
if (grecs_tree_process (tree, pies_keywords))
config_error ();
+
+ if (!control.url)
+ {
+ char const *str = default_control_url[init_process];
+ if (pies_url_create (&control.url, str))
+ {
+ logmsg (LOG_CRIT, _("%s: cannot create control URL: %s"),
+ str, strerror (errno));
+ if (!init_process)
+ exit (EX_OSERR);
+ }
+ }
grecs_tree_free (tree);
@@ -1932,4 +1949,6 @@ pies_check_status (pid_t *ppid)
}
+#define pies_control_url() control.url->string
+
void
request_restart_components (size_t cc, char **cv)
@@ -2231,5 +2250,5 @@ main (int argc, char **argv)
instance++;
}
-
+ setenv ("PIES_INSTANCE", instance, 1);
log_tag = instance;
@@ -2372,7 +2391,10 @@ main (int argc, char **argv)
}
- if (!init_process)
+ if (init_process)
+ ctl_open ();
+ else
{
- ctl_open ();
+ if (ctl_open ())
+ exit (EX_UNAVAILABLE);
create_pidfile (pidfile);
}

Return to:

Send suggestions and report system problems to the System administrator.