diff options
author | Antony Dovgal <tony2001@php.net> | 2009-12-16 09:46:41 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2009-12-16 09:46:41 +0000 |
commit | 0901af0586a980a0323ae910898dcdee9520c41c (patch) | |
tree | 5bbac9971c6b395afeec0f8d439feb35bb949e1c | |
parent | 952efe8aa5dc8e00a99f31683084cedc03717c86 (diff) | |
download | php-git-0901af0586a980a0323ae910898dcdee9520c41c.tar.gz |
make error messages more consistent
-rw-r--r-- | sapi/fpm/fpm/fpm_children.c | 18 | ||||
-rw-r--r-- | sapi/fpm/fpm/fpm_children.h | 2 | ||||
-rw-r--r-- | sapi/fpm/fpm/fpm_conf.c | 18 | ||||
-rw-r--r-- | sapi/fpm/fpm/fpm_events.c | 20 | ||||
-rw-r--r-- | sapi/fpm/fpm/fpm_php_trace.c | 2 | ||||
-rw-r--r-- | sapi/fpm/fpm/fpm_process_ctl.c | 21 | ||||
-rw-r--r-- | sapi/fpm/fpm/fpm_request.c | 8 | ||||
-rw-r--r-- | sapi/fpm/fpm/fpm_stdio.c | 8 | ||||
-rw-r--r-- | sapi/fpm/fpm/fpm_unix.c | 34 |
9 files changed, 68 insertions, 63 deletions
diff --git a/sapi/fpm/fpm/fpm_children.c b/sapi/fpm/fpm/fpm_children.c index 870acb8962..1a3f205074 100644 --- a/sapi/fpm/fpm/fpm_children.c +++ b/sapi/fpm/fpm/fpm_children.c @@ -150,7 +150,7 @@ static void fpm_child_init(struct fpm_worker_pool_s *wp) /* {{{ */ 0 > fpm_env_init_child(wp) || 0 > fpm_php_init_child(wp)) { - zlog(ZLOG_STUFF, ZLOG_ERROR, "child failed to initialize (pool %s)", wp->config->name); + zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] child failed to initialize", wp->config->name); exit(255); } } @@ -241,9 +241,9 @@ void fpm_children_bury() /* {{{ */ timersub(&tv1, &child->started, &tv2); if (restart_child) { - zlog(ZLOG_STUFF, severity, "child %d (pool %s) exited %s after %ld.%06d seconds from start", (int) pid, child->wp->config->name, buf, tv2.tv_sec, (int) tv2.tv_usec); + zlog(ZLOG_STUFF, severity, "[pool %s] child %d exited %s after %ld.%06d seconds from start", child->wp->config->name, (int) pid, buf, tv2.tv_sec, (int) tv2.tv_usec); } else { - zlog(ZLOG_STUFF, severity, "child %d (pool %s) has been killed by the process managment after %ld.%06d seconds from start", (int) pid, child->wp->config->name, tv2.tv_sec, (int) tv2.tv_usec); + zlog(ZLOG_STUFF, ZLOG_DEBUG, "[pool %s] child %d has been killed by the process managment after %ld.%06d seconds from start", child->wp->config->name, (int) pid, tv2.tv_sec, (int) tv2.tv_usec); } fpm_child_close(child, 1 /* in event_loop */); @@ -277,7 +277,7 @@ void fpm_children_bury() /* {{{ */ } if (restart_child) { - fpm_children_make(wp, 1 /* in event loop */, 1); + fpm_children_make(wp, 1 /* in event loop */, 1, 0); if (fpm_globals.is_child) { break; @@ -297,7 +297,7 @@ static struct fpm_child_s *fpm_resources_prepare(struct fpm_worker_pool_s *wp) / c = fpm_child_alloc(); if (!c) { - zlog(ZLOG_STUFF, ZLOG_ERROR, "malloc failed (pool %s)", wp->config->name); + zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] malloc failed", wp->config->name); return 0; } @@ -343,7 +343,7 @@ static void fpm_parent_resources_use(struct fpm_child_s *child) /* {{{ */ } /* }}} */ -int fpm_children_make(struct fpm_worker_pool_s *wp, int in_event_loop, int nb_to_spawn) /* {{{ */ +int fpm_children_make(struct fpm_worker_pool_s *wp, int in_event_loop, int nb_to_spawn, int is_debug) /* {{{ */ { int enough = 0; pid_t pid; @@ -351,7 +351,7 @@ int fpm_children_make(struct fpm_worker_pool_s *wp, int in_event_loop, int nb_to int max; if (wp->config->pm->style == PM_STYLE_DYNAMIC) { - if (!in_event_loop) { /* stating */ + if (!in_event_loop) { /* starting */ max = wp->config->pm->dynamic.start_servers; } else { max = wp->running_children + nb_to_spawn; @@ -394,7 +394,7 @@ int fpm_children_make(struct fpm_worker_pool_s *wp, int in_event_loop, int nb_to fpm_clock_get(&child->started); fpm_parent_resources_use(child); - zlog(ZLOG_STUFF, ZLOG_NOTICE, "child %d (pool %s) started", (int) pid, wp->config->name); + zlog(ZLOG_STUFF, is_debug ? ZLOG_DEBUG : ZLOG_NOTICE, "[pool %s] child %d started", wp->config->name, (int) pid); } } @@ -405,7 +405,7 @@ int fpm_children_make(struct fpm_worker_pool_s *wp, int in_event_loop, int nb_to int fpm_children_create_initial(struct fpm_worker_pool_s *wp) /* {{{ */ { - return fpm_children_make(wp, 0 /* not in event loop yet */, 0); + return fpm_children_make(wp, 0 /* not in event loop yet */, 0, 1); } /* }}} */ diff --git a/sapi/fpm/fpm/fpm_children.h b/sapi/fpm/fpm/fpm_children.h index cf04df245c..3be32fbe33 100644 --- a/sapi/fpm/fpm/fpm_children.h +++ b/sapi/fpm/fpm/fpm_children.h @@ -15,7 +15,7 @@ int fpm_children_create_initial(struct fpm_worker_pool_s *wp); int fpm_children_free(struct fpm_child_s *child); void fpm_children_bury(); int fpm_children_init_main(); -int fpm_children_make(struct fpm_worker_pool_s *wp, int in_event_loop, int nb_to_spawn); +int fpm_children_make(struct fpm_worker_pool_s *wp, int in_event_loop, int nb_to_spawn, int is_debug); struct fpm_child_s; diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c index 0ffe19f0c5..cc726591fc 100644 --- a/sapi/fpm/fpm/fpm_conf.c +++ b/sapi/fpm/fpm/fpm_conf.c @@ -392,7 +392,7 @@ static int fpm_conf_process_all_pools() /* {{{ */ } if (wp->config->pm == NULL) { - zlog(ZLOG_STUFF, ZLOG_ALERT, "pool %s: the process manager is missing (static or dynamic)", wp->config->name); + zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] the process manager is missing (static or dynamic)", wp->config->name); return(-1); } @@ -400,32 +400,32 @@ static int fpm_conf_process_all_pools() /* {{{ */ struct fpm_pm_s *pm = wp->config->pm; if (pm->dynamic.min_spare_servers <= 0) { - zlog(ZLOG_STUFF, ZLOG_ALERT, "pool %s: min_spare_servers must be a positive value", wp->config->name); + zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] min_spare_servers(%d) must be a positive value", wp->config->name, pm->dynamic.min_spare_servers); return(-1); } if (pm->dynamic.max_spare_servers <= 0) { - zlog(ZLOG_STUFF, ZLOG_ALERT, "pool %s: max_spare_servers must be a positive value", wp->config->name); + zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] max_spare_servers(%d) must be a positive value", wp->config->name, pm->dynamic.max_spare_servers); return(-1); } if (pm->dynamic.min_spare_servers > pm->max_children || pm->dynamic.max_spare_servers > pm->max_children) { - zlog(ZLOG_STUFF, ZLOG_ALERT, "pool %s: min_spare_servers(%d) and max_spare_servers(%d) can't be greater than max_children(%d)", + zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] min_spare_servers(%d) and max_spare_servers(%d) cannot be greater than max_children(%d)", wp->config->name, pm->dynamic.min_spare_servers, pm->dynamic.max_spare_servers, pm->max_children); return(-1); } if (pm->dynamic.max_spare_servers < pm->dynamic.min_spare_servers) { - zlog(ZLOG_STUFF, ZLOG_ALERT, "pool %s: max_spare_servers must be greater or equal than min_spare_servers", wp->config->name); + zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] max_spare_servers(%d) must not be less than min_spare_servers(%d)", wp->config->name, pm->dynamic.max_spare_servers, pm->dynamic.min_spare_servers); return(-1); } if (pm->dynamic.start_servers <= 0) { pm->dynamic.start_servers = pm->dynamic.min_spare_servers + ((pm->dynamic.max_spare_servers - pm->dynamic.min_spare_servers) / 2); - zlog(ZLOG_STUFF, ZLOG_NOTICE, "pool %s: start_servers has been set to %d", wp->config->name, pm->dynamic.start_servers); + zlog(ZLOG_STUFF, ZLOG_NOTICE, "[pool %s] start_servers has been set to %d", wp->config->name, pm->dynamic.start_servers); } else if (pm->dynamic.start_servers < pm->dynamic.min_spare_servers || pm->dynamic.start_servers > pm->dynamic.max_spare_servers) { - zlog(ZLOG_STUFF, ZLOG_ALERT, "pool %s: start_servers must not be less than min_spare_servers and not greaters than max_spare_servers", wp->config->name); + zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] start_servers(%d) must not be less than min_spare_servers(%d) and not greater than max_spare_servers(%d)", wp->config->name, pm->dynamic.start_servers, pm->dynamic.min_spare_servers, pm->dynamic.max_spare_servers); return(-1); } } @@ -434,7 +434,7 @@ static int fpm_conf_process_all_pools() /* {{{ */ if (wp->config->request_slowlog_timeout) { #if HAVE_FPM_TRACE if (! (wp->config->slowlog && *wp->config->slowlog)) { - zlog(ZLOG_STUFF, ZLOG_ERROR, "pool %s: 'slowlog' must be specified for use with 'request_slowlog_timeout'", + zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] 'slowlog' must be specified for use with 'request_slowlog_timeout'", wp->config->name); return -1; } @@ -442,7 +442,7 @@ static int fpm_conf_process_all_pools() /* {{{ */ static int warned = 0; if (!warned) { - zlog(ZLOG_STUFF, ZLOG_WARNING, "pool %s: 'request_slowlog_timeout' is not supported on your system", + zlog(ZLOG_STUFF, ZLOG_WARNING, "[pool %s] 'request_slowlog_timeout' is not supported on your system", wp->config->name); warned = 1; } diff --git a/sapi/fpm/fpm/fpm_events.c b/sapi/fpm/fpm/fpm_events.c index 780dfe9c05..4844a17042 100644 --- a/sapi/fpm/fpm/fpm_events.c +++ b/sapi/fpm/fpm/fpm_events.c @@ -45,29 +45,35 @@ static void fpm_got_signal(int fd, short ev, void *arg) /* {{{ */ switch (c) { case 'C' : /* SIGCHLD */ - zlog(ZLOG_STUFF, ZLOG_NOTICE, "received SIGCHLD"); + zlog(ZLOG_STUFF, ZLOG_DEBUG, "received SIGCHLD"); fpm_children_bury(); break; case 'I' : /* SIGINT */ - zlog(ZLOG_STUFF, ZLOG_NOTICE, "received SIGINT"); + zlog(ZLOG_STUFF, ZLOG_DEBUG, "received SIGINT"); + zlog(ZLOG_STUFF, ZLOG_NOTICE, "Terminating ..."); fpm_pctl(FPM_PCTL_STATE_TERMINATING, FPM_PCTL_ACTION_SET); break; case 'T' : /* SIGTERM */ - zlog(ZLOG_STUFF, ZLOG_NOTICE, "received SIGTERM"); + zlog(ZLOG_STUFF, ZLOG_DEBUG, "received SIGTERM"); + zlog(ZLOG_STUFF, ZLOG_NOTICE, "Terminating ..."); fpm_pctl(FPM_PCTL_STATE_TERMINATING, FPM_PCTL_ACTION_SET); break; case 'Q' : /* SIGQUIT */ - zlog(ZLOG_STUFF, ZLOG_NOTICE, "received SIGQUIT"); + zlog(ZLOG_STUFF, ZLOG_DEBUG, "received SIGQUIT"); + zlog(ZLOG_STUFF, ZLOG_NOTICE, "Finishing ..."); fpm_pctl(FPM_PCTL_STATE_FINISHING, FPM_PCTL_ACTION_SET); break; case '1' : /* SIGUSR1 */ - zlog(ZLOG_STUFF, ZLOG_NOTICE, "received SIGUSR1"); + zlog(ZLOG_STUFF, ZLOG_DEBUG, "received SIGUSR1"); if (0 == fpm_stdio_open_error_log(1)) { zlog(ZLOG_STUFF, ZLOG_NOTICE, "log file re-opened"); + } else { + zlog(ZLOG_STUFF, ZLOG_ERROR, "unable to re-opened log file"); } break; case '2' : /* SIGUSR2 */ - zlog(ZLOG_STUFF, ZLOG_NOTICE, "received SIGUSR2"); + zlog(ZLOG_STUFF, ZLOG_DEBUG, "received SIGUSR2"); + zlog(ZLOG_STUFF, ZLOG_NOTICE, "Reloading in progress ..."); fpm_pctl(FPM_PCTL_STATE_RELOADING, FPM_PCTL_ACTION_SET); break; } @@ -101,7 +107,7 @@ int fpm_event_loop() /* {{{ */ event_add(&signal_fd_event, 0); fpm_pctl_heartbeat(-1, 0, 0); fpm_pctl_perform_idle_server_maintenance_heartbeat(-1, 0, 0); - zlog(ZLOG_STUFF, ZLOG_NOTICE, "libevent: entering main loop"); + zlog(ZLOG_STUFF, ZLOG_NOTICE, "ready to handle connections"); event_loop(0); return 0; } diff --git a/sapi/fpm/fpm/fpm_php_trace.c b/sapi/fpm/fpm/fpm_php_trace.c index cfcc58ce98..306a592c86 100644 --- a/sapi/fpm/fpm/fpm_php_trace.c +++ b/sapi/fpm/fpm/fpm_php_trace.c @@ -53,7 +53,7 @@ static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog TSRMLS_DC zlog_print_time(&tv, buf, buf_size); - fprintf(slowlog, "\n%s pid %d (pool %s)\n", buf, (int) pid, child->wp->config->name); + fprintf(slowlog, "\n%s [pool %s] pid %d\n", buf, child->wp->config->name, (int) pid); if (0 > fpm_trace_get_strz(buf, buf_size, (long) &SG(request_info).path_translated)) { return -1; diff --git a/sapi/fpm/fpm/fpm_process_ctl.c b/sapi/fpm/fpm/fpm_process_ctl.c index 4d71ac160c..dbdf9533fa 100644 --- a/sapi/fpm/fpm/fpm_process_ctl.c +++ b/sapi/fpm/fpm/fpm_process_ctl.c @@ -157,9 +157,9 @@ static void fpm_pctl_kill_all(int signo) /* {{{ */ for (child = wp->children; child; child = child->next) { int res = kill(child->pid, signo); - zlog(ZLOG_STUFF, ZLOG_NOTICE, "sending signal %d %s to child %d (pool %s)", signo, - fpm_signal_names[signo] ? fpm_signal_names[signo] : "", - (int) child->pid, child->wp->config->name); + zlog(ZLOG_STUFF, ZLOG_NOTICE, "[pool %s] sending signal %d %s to child %d", + child->wp->config->name, signo, + fpm_signal_names[signo] ? fpm_signal_names[signo] : "", (int) child->pid); if (res == 0) { ++alive_children; @@ -168,7 +168,7 @@ static void fpm_pctl_kill_all(int signo) /* {{{ */ } if (alive_children) { - zlog(ZLOG_STUFF, ZLOG_NOTICE, "%d %s still alive", alive_children, alive_children == 1 ? "child is" : "children are"); + zlog(ZLOG_STUFF, ZLOG_NOTICE, "%d child(ren) still alive", alive_children); } } /* }}} */ @@ -340,10 +340,10 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now) /* {{{ } } - zlog(ZLOG_STUFF, ZLOG_DEBUG, "[%s] rate=%d idle=%d active=%d total=%d", wp->config->name, wp->idle_spawn_rate, idle, active, wp->running_children); + zlog(ZLOG_STUFF, ZLOG_DEBUG, "[pool %s] currently %d active children, %d spare children, %d running children. Spawning rate %d", wp->config->name, active, idle, wp->running_children, wp->idle_spawn_rate); if ((active + idle) != wp->running_children) { - zlog(ZLOG_STUFF, ZLOG_ERROR, "[%s] unable to retrieve spawning informations", wp->config->name); + zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] unable to retrieve process activiry of one or more child(ren). Will try again later.", wp->config->name); continue; } @@ -357,8 +357,7 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now) /* {{{ if (idle < wp->config->pm->dynamic.min_spare_servers) { if (wp->running_children >= wp->config->pm->max_children) { if (!wp->warn_max_children) { - zlog(ZLOG_STUFF, ZLOG_WARNING, "pool %s: server reached max_children setting, consider raising it", - wp->config->name); + zlog(ZLOG_STUFF, ZLOG_WARNING, "[pool %s] server reached max_children setting (%d), consider raising it", wp->config->name, wp->config->pm->max_children); wp->warn_max_children = 1; } wp->idle_spawn_rate = 1; @@ -367,11 +366,11 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now) /* {{{ wp->warn_max_children = 0; if (wp->idle_spawn_rate >= 8) { - zlog(ZLOG_STUFF, ZLOG_WARNING, "pool %s seems busy (you may need to increase start_servers, or min/max_spare_servers), spawning %d children, there are %d idle, and %d total children", wp->config->name, wp->idle_spawn_rate, idle, wp->running_children); + zlog(ZLOG_STUFF, ZLOG_WARNING, "[pool %s] seems busy (you may need to increase start_servers, or min/max_spare_servers), spawning %d children, there are %d idle, and %d total children", wp->config->name, wp->idle_spawn_rate, idle, wp->running_children); } i = MIN(wp->idle_spawn_rate, wp->config->pm->dynamic.min_spare_servers - idle); - fpm_children_make(wp, 1, i); + fpm_children_make(wp, 1, i, 1); /* if it's a child, stop here without creating the next event * this event is reserved to the master process @@ -380,7 +379,7 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now) /* {{{ return; } - zlog(ZLOG_STUFF, ZLOG_NOTICE, "pool %s: %d child(ren) have been created because of not enough spare children", wp->config->name, i); + zlog(ZLOG_STUFF, ZLOG_DEBUG, "[pool %s] %d child(ren) have been created dynamically", wp->config->name, i); /* Double the spawn rate for the next iteration */ if (wp->idle_spawn_rate < FPM_MAX_SPAWN_RATE) { diff --git a/sapi/fpm/fpm/fpm_request.c b/sapi/fpm/fpm/fpm_request.c index df19f9ce77..1aedeaf557 100644 --- a/sapi/fpm/fpm/fpm_request.c +++ b/sapi/fpm/fpm/fpm_request.c @@ -132,8 +132,8 @@ void fpm_request_check_timed_out(struct fpm_child_s *child, struct timeval *now, fpm_trace_signal(child->pid); - zlog(ZLOG_STUFF, ZLOG_WARNING, "child %d, script '%s' (pool %s) executing too slow (%d.%06d sec), logging", - (int) child->pid, purified_script_filename, child->wp->config->name, (int) tv.tv_sec, (int) tv.tv_usec); + zlog(ZLOG_STUFF, ZLOG_WARNING, "[pool %s] child %d, script '%s' executing too slow (%d.%06d sec), logging", + child->wp->config->name, (int) child->pid, purified_script_filename, (int) tv.tv_sec, (int) tv.tv_usec); } else #endif @@ -141,8 +141,8 @@ void fpm_request_check_timed_out(struct fpm_child_s *child, struct timeval *now, str_purify_filename(purified_script_filename, slot_c.script_filename, sizeof(slot_c.script_filename)); fpm_pctl_kill(child->pid, FPM_PCTL_TERM); - zlog(ZLOG_STUFF, ZLOG_WARNING, "child %d, script '%s' (pool %s) execution timed out (%d.%06d sec), terminating", - (int) child->pid, purified_script_filename, child->wp->config->name, (int) tv.tv_sec, (int) tv.tv_usec); + zlog(ZLOG_STUFF, ZLOG_WARNING, "[pool %s] child %d, script '%s' execution timed out (%d.%06d sec), terminating", + child->wp->config->name, (int) child->pid, purified_script_filename, (int) tv.tv_sec, (int) tv.tv_usec); } } } diff --git a/sapi/fpm/fpm/fpm_stdio.c b/sapi/fpm/fpm/fpm_stdio.c index f9d665f424..9726936b33 100644 --- a/sapi/fpm/fpm/fpm_stdio.c +++ b/sapi/fpm/fpm/fpm_stdio.c @@ -114,8 +114,8 @@ static void fpm_stdio_child_said(int fd, short which, void *arg) /* {{{ */ #if 0 if (in_buf == 0 && !fpm_globals.is_child) { - zlog(ZLOG_STUFF, ZLOG_DEBUG, "child %d (pool %s) %s pipe is closed", (int) child->pid, - child->wp->config->name, is_stdout ? "stdout" : "stderr"); + zlog(ZLOG_STUFF, ZLOG_DEBUG, "[pool %s] child %d, %s pipe is closed", child->wp->config->name, + (int) child->pid, is_stdout ? "stdout" : "stderr"); } #endif } @@ -151,8 +151,8 @@ static void fpm_stdio_child_said(int fd, short which, void *arg) /* {{{ */ *nl = '\0'; } - zlog(ZLOG_STUFF, ZLOG_WARNING, "child %d (pool %s) said into %s: \"%s\"%s", (int) child->pid, - child->wp->config->name, is_stdout ? "stdout" : "stderr", buf, is_last_message ? ", pipe is closed" : ""); + zlog(ZLOG_STUFF, ZLOG_WARNING, "[pool %s] child %d said into %s: \"%s\"%s", child->wp->config->name, + (int) child->pid, is_stdout ? "stdout" : "stderr", buf, is_last_message ? ", pipe is closed" : ""); if (nl) { int out_buf = 1 + nl - buf; diff --git a/sapi/fpm/fpm/fpm_unix.c b/sapi/fpm/fpm/fpm_unix.c index 00a2ec9a45..ba693b6421 100644 --- a/sapi/fpm/fpm/fpm_unix.c +++ b/sapi/fpm/fpm/fpm_unix.c @@ -45,7 +45,7 @@ int fpm_unix_resolve_socket_premissions(struct fpm_worker_pool_s *wp) /* {{{ */ pwd = getpwnam(lo->owner); if (!pwd) { - zlog(ZLOG_STUFF, ZLOG_SYSERROR, "cannot get uid for user '%s', pool '%s'", lo->owner, wp->config->name); + zlog(ZLOG_STUFF, ZLOG_SYSERROR, "[pool %s] cannot get uid for user '%s'", wp->config->name, lo->owner); return -1; } @@ -58,7 +58,7 @@ int fpm_unix_resolve_socket_premissions(struct fpm_worker_pool_s *wp) /* {{{ */ grp = getgrnam(lo->group); if (!grp) { - zlog(ZLOG_STUFF, ZLOG_SYSERROR, "cannot get gid for group '%s', pool '%s'", lo->group, wp->config->name); + zlog(ZLOG_STUFF, ZLOG_SYSERROR, "[pool %s] cannot get gid for group '%s'", wp->config->name, lo->group); return -1; } wp->socket_gid = grp->gr_gid; @@ -84,7 +84,7 @@ static int fpm_unix_conf_wp(struct fpm_worker_pool_s *wp) /* {{{ */ pwd = getpwnam(wp->config->user); if (!pwd) { - zlog(ZLOG_STUFF, ZLOG_ERROR, "cannot get uid for user '%s', pool '%s'", wp->config->user, wp->config->name); + zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] cannot get uid for user '%s'", wp->config->name, wp->config->user); return -1; } @@ -104,7 +104,7 @@ static int fpm_unix_conf_wp(struct fpm_worker_pool_s *wp) /* {{{ */ grp = getgrnam(wp->config->group); if (!grp) { - zlog(ZLOG_STUFF, ZLOG_ERROR, "cannot get gid for group '%s', pool '%s'", wp->config->group, wp->config->name); + zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] cannot get gid for group '%s'", wp->config->name, wp->config->group); return -1; } wp->set_gid = grp->gr_gid; @@ -113,19 +113,19 @@ static int fpm_unix_conf_wp(struct fpm_worker_pool_s *wp) /* {{{ */ #ifndef I_REALLY_WANT_ROOT_PHP if (wp->set_uid == 0 || wp->set_gid == 0) { - zlog(ZLOG_STUFF, ZLOG_ERROR, "please specify user and group other than root, pool '%s'", wp->config->name); + zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] please specify user and group other than root", wp->config->name); return -1; } #endif } else { /* not root */ if (wp->config->user && *wp->config->user) { - zlog(ZLOG_STUFF, ZLOG_WARNING, "'user' directive is ignored, pool '%s'", wp->config->name); + zlog(ZLOG_STUFF, ZLOG_WARNING, "[pool %s] 'user' directive is ignored", wp->config->name); } if (wp->config->group && *wp->config->group) { - zlog(ZLOG_STUFF, ZLOG_WARNING, "'group' directive is ignored, pool '%s'", wp->config->name); + zlog(ZLOG_STUFF, ZLOG_WARNING, "[pool %s] 'group' directive is ignored", wp->config->name); } if (wp->config->chroot && *wp->config->chroot) { - zlog(ZLOG_STUFF, ZLOG_WARNING, "'chroot' directive is ignored, pool '%s'", wp->config->name); + zlog(ZLOG_STUFF, ZLOG_WARNING, "[pool %s] 'chroot' directive is ignored", wp->config->name); } { /* set up HOME and USER anyway */ @@ -153,7 +153,7 @@ int fpm_unix_init_child(struct fpm_worker_pool_s *wp) /* {{{ */ getrlimit(RLIMIT_NOFILE, &r); r.rlim_cur = (rlim_t) wp->config->rlimit_files; if (0 > setrlimit(RLIMIT_NOFILE, &r)) { - zlog(ZLOG_STUFF, ZLOG_SYSERROR, "setrlimit(RLIMIT_NOFILE) failed"); + zlog(ZLOG_STUFF, ZLOG_SYSERROR, "[pool %s] setrlimit(RLIMIT_NOFILE) failed", wp->config->name); } } @@ -163,13 +163,13 @@ int fpm_unix_init_child(struct fpm_worker_pool_s *wp) /* {{{ */ getrlimit(RLIMIT_CORE, &r); r.rlim_cur = wp->config->rlimit_core == -1 ? (rlim_t) RLIM_INFINITY : (rlim_t) wp->config->rlimit_core; if (0 > setrlimit(RLIMIT_CORE, &r)) { - zlog(ZLOG_STUFF, ZLOG_SYSERROR, "setrlimit(RLIMIT_CORE) failed"); + zlog(ZLOG_STUFF, ZLOG_SYSERROR, "[pool %s] setrlimit(RLIMIT_CORE) failed", wp->config->name); } } if (is_root && wp->config->chroot && *wp->config->chroot) { if (0 > chroot(wp->config->chroot)) { - zlog(ZLOG_STUFF, ZLOG_SYSERROR, "chroot(%s) failed", wp->config->chroot); + zlog(ZLOG_STUFF, ZLOG_SYSERROR, "[pool %s] chroot(%s) failed", wp->config->name, wp->config->chroot); return -1; } made_chroot = 1; @@ -177,7 +177,7 @@ int fpm_unix_init_child(struct fpm_worker_pool_s *wp) /* {{{ */ if (wp->config->chdir && *wp->config->chdir) { if (0 > chdir(wp->config->chdir)) { - zlog(ZLOG_STUFF, ZLOG_SYSERROR, "chdir(%s) failed", wp->config->chdir); + zlog(ZLOG_STUFF, ZLOG_SYSERROR, "[pool %s] chdir(%s) failed", wp->config->name, wp->config->chdir); return -1; } } else if (made_chroot) { @@ -187,17 +187,17 @@ int fpm_unix_init_child(struct fpm_worker_pool_s *wp) /* {{{ */ if (is_root) { if (wp->set_gid) { if (0 > setgid(wp->set_gid)) { - zlog(ZLOG_STUFF, ZLOG_SYSERROR, "setgid(%d) failed", wp->set_gid); + zlog(ZLOG_STUFF, ZLOG_SYSERROR, "[pool %s] setgid(%d) failed", wp->config->name, wp->set_gid); return -1; } } if (wp->set_uid) { if (0 > initgroups(wp->config->user, wp->set_gid)) { - zlog(ZLOG_STUFF, ZLOG_SYSERROR, "initgroups(%s, %d) failed", wp->config->user, wp->set_gid); + zlog(ZLOG_STUFF, ZLOG_SYSERROR, "[pool %s] initgroups(%s, %d) failed", wp->config->name, wp->config->user, wp->set_gid); return -1; } if (0 > setuid(wp->set_uid)) { - zlog(ZLOG_STUFF, ZLOG_SYSERROR, "setuid(%d) failed", wp->set_uid); + zlog(ZLOG_STUFF, ZLOG_SYSERROR, "[pool %s] setuid(%d) failed", wp->config->name, wp->set_uid); return -1; } } @@ -205,7 +205,7 @@ int fpm_unix_init_child(struct fpm_worker_pool_s *wp) /* {{{ */ #ifdef HAVE_PRCTL if (0 > prctl(PR_SET_DUMPABLE, 1, 0, 0, 0)) { - zlog(ZLOG_STUFF, ZLOG_SYSERROR, "prctl(PR_SET_DUMPABLE) failed"); + zlog(ZLOG_STUFF, ZLOG_SYSERROR, "[pool %s] prctl(PR_SET_DUMPABLE) failed", wp->config->name); } #endif @@ -224,7 +224,7 @@ int fpm_unix_init_main() /* {{{ */ if (fpm_global_config.daemonize) { switch (fork()) { case -1 : - zlog(ZLOG_STUFF, ZLOG_SYSERROR, "fork() failed"); + zlog(ZLOG_STUFF, ZLOG_SYSERROR, "daemonized fork() failed"); return -1; case 0 : break; |