diff options
Diffstat (limited to 'src/pies.c')
-rw-r--r-- | src/pies.c | 28 |
1 files changed, 25 insertions, 3 deletions
@@ -58,6 +58,11 @@ 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 { enum config_syntax syntax; @@ -1750,6 +1755,18 @@ 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); } @@ -1931,6 +1948,8 @@ pies_check_status (pid_t *ppid) return pies_status_running; } +#define pies_control_url() control.url->string + void request_restart_components (size_t cc, char **cv) { @@ -2230,7 +2249,7 @@ main (int argc, char **argv) else instance++; } - + setenv ("PIES_INSTANCE", instance, 1); log_tag = instance; if (!init_process) @@ -2371,9 +2390,12 @@ main (int argc, char **argv) diag_setup (DIAG_TO_SYSLOG); } - if (!init_process) - { + if (init_process) ctl_open (); + else + { + if (ctl_open ()) + exit (EX_UNAVAILABLE); create_pidfile (pidfile); } |