Lines Matching refs:wp

618 	struct fpm_worker_pool_s *wp;  in fpm_worker_pool_config_alloc()  local
620 wp = fpm_worker_pool_alloc(); in fpm_worker_pool_config_alloc()
622 if (!wp) { in fpm_worker_pool_config_alloc()
626 wp->config = malloc(sizeof(struct fpm_worker_pool_config_s)); in fpm_worker_pool_config_alloc()
628 if (!wp->config) { in fpm_worker_pool_config_alloc()
629 fpm_worker_pool_free(wp); in fpm_worker_pool_config_alloc()
633 memset(wp->config, 0, sizeof(struct fpm_worker_pool_config_s)); in fpm_worker_pool_config_alloc()
634 wp->config->listen_backlog = FPM_BACKLOG_DEFAULT; in fpm_worker_pool_config_alloc()
635 wp->config->pm_max_spawn_rate = 32; /* 32 by default */ in fpm_worker_pool_config_alloc()
636 wp->config->pm_process_idle_timeout = 10; /* 10s by default */ in fpm_worker_pool_config_alloc()
637 wp->config->process_priority = 64; /* 64 means unset */ in fpm_worker_pool_config_alloc()
638 wp->config->process_dumpable = 0; in fpm_worker_pool_config_alloc()
639 wp->config->clear_env = 1; in fpm_worker_pool_config_alloc()
640 wp->config->decorate_workers_output = 1; in fpm_worker_pool_config_alloc()
642 wp->config->listen_setfib = -1; in fpm_worker_pool_config_alloc()
646 fpm_worker_all_pools = wp; in fpm_worker_pool_config_alloc()
651 tmp->next = wp; in fpm_worker_pool_config_alloc()
658 current_wp = wp; in fpm_worker_pool_config_alloc()
659 return wp->config; in fpm_worker_pool_config_alloc()
781 static int fpm_evaluate_full_path(char **path, struct fpm_worker_pool_s *wp, char *default_prefix, … in fpm_evaluate_full_path() argument
790 if (wp && wp->config) { in fpm_evaluate_full_path()
791 prefix = wp->config->prefix; in fpm_evaluate_full_path()
834 if (**path != '/' && wp != NULL && wp->config) { in fpm_evaluate_full_path()
843 struct fpm_worker_pool_s *wp, *wp2; in fpm_conf_process_all_pools() local
850 for (wp = fpm_worker_all_pools; wp; wp = wp->next) { in fpm_conf_process_all_pools()
853 if (wp->config->prefix && *wp->config->prefix) { in fpm_conf_process_all_pools()
854 fpm_evaluate_full_path(&wp->config->prefix, NULL, NULL, 0); in fpm_conf_process_all_pools()
856 if (!fpm_conf_is_dir(wp->config->prefix)) { in fpm_conf_process_all_pools()
857 …"[pool %s] the prefix '%s' does not exist or is not a directory", wp->config->name, wp->config->pr… in fpm_conf_process_all_pools()
863 if (!wp->config->user && !geteuid() && !fpm_globals.run_as_root) { in fpm_conf_process_all_pools()
864 zlog(ZLOG_ALERT, "[pool %s] user has not been defined", wp->config->name); in fpm_conf_process_all_pools()
869 if (wp->config->listen_address && *wp->config->listen_address) { in fpm_conf_process_all_pools()
870 wp->listen_address_domain = fpm_sockets_domain_from_address(wp->config->listen_address); in fpm_conf_process_all_pools()
872 if (wp->listen_address_domain == FPM_AF_UNIX && *wp->config->listen_address != '/') { in fpm_conf_process_all_pools()
873 fpm_evaluate_full_path(&wp->config->listen_address, wp, NULL, 0); in fpm_conf_process_all_pools()
876 zlog(ZLOG_ALERT, "[pool %s] no listen address have been defined!", wp->config->name); in fpm_conf_process_all_pools()
880 …if (wp->config->process_priority != 64 && (wp->config->process_priority < -19 || wp->config->proce… in fpm_conf_process_all_pools()
881 zlog(ZLOG_ERROR, "[pool %s] process.priority must be included into [-19,20]", wp->config->name); in fpm_conf_process_all_pools()
886 …if (wp->config->pm != PM_STYLE_STATIC && wp->config->pm != PM_STYLE_DYNAMIC && wp->config->pm != P… in fpm_conf_process_all_pools()
887 …zlog(ZLOG_ALERT, "[pool %s] the process manager is missing (static, dynamic or ondemand)", wp->con… in fpm_conf_process_all_pools()
892 if (wp->config->pm_max_children < 1) { in fpm_conf_process_all_pools()
893 zlog(ZLOG_ALERT, "[pool %s] pm.max_children must be a positive value", wp->config->name); in fpm_conf_process_all_pools()
898 if (wp->config->pm == PM_STYLE_DYNAMIC) { in fpm_conf_process_all_pools()
899 struct fpm_worker_pool_config_s *config = wp->config; in fpm_conf_process_all_pools()
902 …zlog(ZLOG_ALERT, "[pool %s] pm.min_spare_servers(%d) must be a positive value", wp->config->name, … in fpm_conf_process_all_pools()
907 …zlog(ZLOG_ALERT, "[pool %s] pm.max_spare_servers(%d) must be a positive value", wp->config->name, … in fpm_conf_process_all_pools()
913 … and pm.max_spare_servers(%d) cannot be greater than pm.max_children(%d)", wp->config->name, confi… in fpm_conf_process_all_pools()
918 … pm.max_spare_servers(%d) must not be less than pm.min_spare_servers(%d)", wp->config->name, confi… in fpm_conf_process_all_pools()
924 …zlog(ZLOG_NOTICE, "[pool %s] pm.start_servers is not set. It's been set to %d.", wp->config->name,… in fpm_conf_process_all_pools()
927 …n pm.min_spare_servers(%d) and not greater than pm.max_spare_servers(%d)", wp->config->name, confi… in fpm_conf_process_all_pools()
932 zlog(ZLOG_ALERT, "[pool %s] pm.max_spawn_rate must be a positive value", wp->config->name); in fpm_conf_process_all_pools()
935 } else if (wp->config->pm == PM_STYLE_ONDEMAND) { in fpm_conf_process_all_pools()
936 struct fpm_worker_pool_config_s *config = wp->config; in fpm_conf_process_all_pools()
939 …n ONLY be used when events.mechanism is either epoll (Linux) or kqueue (*BSD).", wp->config->name); in fpm_conf_process_all_pools()
944 …zlog(ZLOG_ALERT, "[pool %s] pm.process_idle_timeout(%ds) must be greater than 0s", wp->config->nam… in fpm_conf_process_all_pools()
949 …as too low for the ondemand process manager. I updated it for you to %d.", wp->config->name, confi… in fpm_conf_process_all_pools()
960 if (wp->config->pm_status_listen && fpm_worker_pool_shared_status_alloc(wp)) { in fpm_conf_process_all_pools()
961 zlog(ZLOG_ERROR, "[pool %s] failed to initialize a status listener pool", wp->config->name); in fpm_conf_process_all_pools()
964 if (wp->config->pm_status_path && *wp->config->pm_status_path) { in fpm_conf_process_all_pools()
966 char *status = wp->config->pm_status_path; in fpm_conf_process_all_pools()
969 …zlog(ZLOG_ERROR, "[pool %s] the status path '%s' must start with a '/'", wp->config->name, status); in fpm_conf_process_all_pools()
973 if (!wp->config->pm_status_listen && !wp->shared && strlen(status) < 2) { in fpm_conf_process_all_pools()
974 zlog(ZLOG_ERROR, "[pool %s] the status path '%s' is not long enough", wp->config->name, status); in fpm_conf_process_all_pools()
980 …s path '%s' must contain only the following characters '[alphanum]/_-.~'", wp->config->name, statu… in fpm_conf_process_all_pools()
987 if (wp->config->ping_path && *wp->config->ping_path) { in fpm_conf_process_all_pools()
988 char *ping = wp->config->ping_path; in fpm_conf_process_all_pools()
992 zlog(ZLOG_ERROR, "[pool %s] the ping path '%s' must start with a '/'", wp->config->name, ping); in fpm_conf_process_all_pools()
997 zlog(ZLOG_ERROR, "[pool %s] the ping path '%s' is not long enough", wp->config->name, ping); in fpm_conf_process_all_pools()
1003 …g path '%s' must contain only the following characters '[alphanum]/_-.~'", wp->config->name, ping); in fpm_conf_process_all_pools()
1008 if (!wp->config->ping_response) { in fpm_conf_process_all_pools()
1009 wp->config->ping_response = strdup("pong"); in fpm_conf_process_all_pools()
1011 if (strlen(wp->config->ping_response) < 1) { in fpm_conf_process_all_pools()
1012 …RROR, "[pool %s] the ping response page '%s' is not long enough", wp->config->name, wp->config->pi… in fpm_conf_process_all_pools()
1017 if (wp->config->ping_response) { in fpm_conf_process_all_pools()
1018 free(wp->config->ping_response); in fpm_conf_process_all_pools()
1019 wp->config->ping_response = NULL; in fpm_conf_process_all_pools()
1024 if (wp->config->access_log && *wp->config->access_log) { in fpm_conf_process_all_pools()
1025 fpm_evaluate_full_path(&wp->config->access_log, wp, NULL, 0); in fpm_conf_process_all_pools()
1026 if (!wp->config->access_format) { in fpm_conf_process_all_pools()
1027 wp->config->access_format = strdup("%R - %u %t \"%m %r\" %s"); in fpm_conf_process_all_pools()
1031 if (wp->config->request_terminate_timeout) { in fpm_conf_process_all_pools()
1032 …globals.heartbeat ? MIN(fpm_globals.heartbeat, (wp->config->request_terminate_timeout * 1000) / 3)… in fpm_conf_process_all_pools()
1036 if (wp->config->slowlog && *wp->config->slowlog) { in fpm_conf_process_all_pools()
1037 fpm_evaluate_full_path(&wp->config->slowlog, wp, NULL, 0); in fpm_conf_process_all_pools()
1041 if (wp->config->request_slowlog_timeout) { in fpm_conf_process_all_pools()
1043 if (! (wp->config->slowlog && *wp->config->slowlog)) { in fpm_conf_process_all_pools()
1044 … "[pool %s] 'slowlog' must be specified for use with 'request_slowlog_timeout'", wp->config->name); in fpm_conf_process_all_pools()
1051 …zlog(ZLOG_WARNING, "[pool %s] 'request_slowlog_timeout' is not supported on your system", wp->conf… in fpm_conf_process_all_pools()
1055 wp->config->request_slowlog_timeout = 0; in fpm_conf_process_all_pools()
1058 if (wp->config->slowlog && *wp->config->slowlog) { in fpm_conf_process_all_pools()
1061 fd = open(wp->config->slowlog, O_WRONLY | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR); in fpm_conf_process_all_pools()
1064 zlog(ZLOG_SYSERROR, "Unable to create or open slowlog(%s)", wp->config->slowlog); in fpm_conf_process_all_pools()
1070 …_globals.heartbeat ? MIN(fpm_globals.heartbeat, (wp->config->request_slowlog_timeout * 1000) / 3) … in fpm_conf_process_all_pools()
1072 …if (wp->config->request_terminate_timeout && wp->config->request_slowlog_timeout > wp->config->req… in fpm_conf_process_all_pools()
1073 …greater than 'request_terminate_timeout' (%d)", wp->config->name, wp->config->request_slowlog_time… in fpm_conf_process_all_pools()
1079 if (wp->config->request_slowlog_trace_depth) { in fpm_conf_process_all_pools()
1081 if (! (wp->config->slowlog && *wp->config->slowlog)) { in fpm_conf_process_all_pools()
1082 …ool %s] 'slowlog' must be specified for use with 'request_slowlog_trace_depth'", wp->config->name); in fpm_conf_process_all_pools()
1089 …NING, "[pool %s] 'request_slowlog_trace_depth' is not supported on your system", wp->config->name); in fpm_conf_process_all_pools()
1094 if (wp->config->request_slowlog_trace_depth <= 0) { in fpm_conf_process_all_pools()
1095 …%s] 'request_slowlog_trace_depth' (%d) must be a positive value", wp->config->name, wp->config->re… in fpm_conf_process_all_pools()
1099 wp->config->request_slowlog_trace_depth = 20; in fpm_conf_process_all_pools()
1103 if (wp->config->chroot && *wp->config->chroot) { in fpm_conf_process_all_pools()
1105 fpm_evaluate_full_path(&wp->config->chroot, wp, NULL, 1); in fpm_conf_process_all_pools()
1107 if (*wp->config->chroot != '/') { in fpm_conf_process_all_pools()
1108 …zlog(ZLOG_ERROR, "[pool %s] the chroot path '%s' must start with a '/'", wp->config->name, wp->con… in fpm_conf_process_all_pools()
1112 if (!fpm_conf_is_dir(wp->config->chroot)) { in fpm_conf_process_all_pools()
1113 …l %s] the chroot path '%s' does not exist or is not a directory", wp->config->name, wp->config->ch… in fpm_conf_process_all_pools()
1119 if (wp->config->chdir && *wp->config->chdir) { in fpm_conf_process_all_pools()
1121 fpm_evaluate_full_path(&wp->config->chdir, wp, NULL, 0); in fpm_conf_process_all_pools()
1123 if (*wp->config->chdir != '/') { in fpm_conf_process_all_pools()
1124 …zlog(ZLOG_ERROR, "[pool %s] the chdir path '%s' must start with a '/'", wp->config->name, wp->conf… in fpm_conf_process_all_pools()
1128 if (wp->config->chroot) { in fpm_conf_process_all_pools()
1131 spprintf(&buf, 0, "%s/%s", wp->config->chroot, wp->config->chdir); in fpm_conf_process_all_pools()
1134 … path '%s' ('%s') does not exist or is not a directory", wp->config->name, wp->config->chdir, wp->… in fpm_conf_process_all_pools()
1141 if (!fpm_conf_is_dir(wp->config->chdir)) { in fpm_conf_process_all_pools()
1142 …ol %s] the chdir path '%s' does not exist or is not a directory", wp->config->name, wp->config->ch… in fpm_conf_process_all_pools()
1149 if (!wp->config->security_limit_extensions) { in fpm_conf_process_all_pools()
1150 wp->config->security_limit_extensions = strdup(".php .phar"); in fpm_conf_process_all_pools()
1153 if (*wp->config->security_limit_extensions) { in fpm_conf_process_all_pools()
1161 security_limit_extensions = strdup(wp->config->security_limit_extensions); in fpm_conf_process_all_pools()
1176 wp->limit_extensions = malloc(sizeof(char *) * (nb_ext + 1)); in fpm_conf_process_all_pools()
1177 if (!wp->limit_extensions) { in fpm_conf_process_all_pools()
1178 zlog(ZLOG_ERROR, "[pool %s] unable to malloc extensions array", wp->config->name); in fpm_conf_process_all_pools()
1183 security_limit_extensions = strdup(wp->config->security_limit_extensions); in fpm_conf_process_all_pools()
1190 wp->limit_extensions[nb_ext++] = strdup(ext); in fpm_conf_process_all_pools()
1194 wp->limit_extensions[nb_ext] = NULL; in fpm_conf_process_all_pools()
1200 if (!wp->config->chroot) { in fpm_conf_process_all_pools()
1204 for (kv = wp->config->php_values; kv; kv = kv->next) { in fpm_conf_process_all_pools()
1207 fpm_evaluate_full_path(&kv->value, wp, NULL, 0); in fpm_conf_process_all_pools()
1211 for (kv = wp->config->php_admin_values; kv; kv = kv->next) { in fpm_conf_process_all_pools()
1217 fpm_evaluate_full_path(&kv->value, wp, NULL, 0); in fpm_conf_process_all_pools()
1225 for (wp = fpm_worker_all_pools; wp; wp = wp->next) { in fpm_conf_process_all_pools()
1227 if (wp == wp2) { in fpm_conf_process_all_pools()
1231 …if (wp->config->listen_address && *wp->config->listen_address && wp2->config->listen_address && *w… in fpm_conf_process_all_pools()
1232 …et listen address as it's already used in another pool '%s'", wp2->config->name, wp->config->name); in fpm_conf_process_all_pools()
1281 struct fpm_worker_pool_s *wp; in fpm_conf_post_process() local
1356 for (wp = fpm_worker_all_pools; wp; wp = wp->next) { in fpm_conf_post_process()
1357 if (!wp->config->access_log || !*wp->config->access_log) { in fpm_conf_post_process()
1360 if (0 > fpm_log_write(wp->config->access_format)) { in fpm_conf_post_process()
1361 …zlog(ZLOG_ERROR, "[pool %s] wrong format for access.format '%s'", wp->config->name, wp->config->ac… in fpm_conf_post_process()
1444 struct fpm_worker_pool_s *wp; in fpm_conf_ini_parser_section() local
1454 for (wp = fpm_worker_all_pools; wp; wp = wp->next) { in fpm_conf_ini_parser_section()
1455 if (!wp->config) continue; in fpm_conf_ini_parser_section()
1456 if (!wp->config->name) continue; in fpm_conf_ini_parser_section()
1457 if (!strcasecmp(wp->config->name, Z_STRVAL_P(section))) { in fpm_conf_ini_parser_section()
1459 current_wp = wp; in fpm_conf_ini_parser_section()
1727 struct fpm_worker_pool_s *wp; in fpm_conf_dump() local
1760 for (wp = fpm_worker_all_pools; wp; wp = wp->next) { in fpm_conf_dump()
1763 if (!wp->config || wp->shared) { in fpm_conf_dump()
1767 zlog(ZLOG_NOTICE, "[%s]", STR2STR(wp->config->name)); in fpm_conf_dump()
1768 zlog(ZLOG_NOTICE, "\tprefix = %s", STR2STR(wp->config->prefix)); in fpm_conf_dump()
1769 zlog(ZLOG_NOTICE, "\tuser = %s", STR2STR(wp->config->user)); in fpm_conf_dump()
1770 zlog(ZLOG_NOTICE, "\tgroup = %s", STR2STR(wp->config->group)); in fpm_conf_dump()
1771 zlog(ZLOG_NOTICE, "\tlisten = %s", STR2STR(wp->config->listen_address)); in fpm_conf_dump()
1772 zlog(ZLOG_NOTICE, "\tlisten.backlog = %d", wp->config->listen_backlog); in fpm_conf_dump()
1774 zlog(ZLOG_NOTICE, "\tlisten.acl_users = %s", STR2STR(wp->config->listen_acl_users)); in fpm_conf_dump()
1775 zlog(ZLOG_NOTICE, "\tlisten.acl_groups = %s", STR2STR(wp->config->listen_acl_groups)); in fpm_conf_dump()
1777 zlog(ZLOG_NOTICE, "\tlisten.owner = %s", STR2STR(wp->config->listen_owner)); in fpm_conf_dump()
1778 zlog(ZLOG_NOTICE, "\tlisten.group = %s", STR2STR(wp->config->listen_group)); in fpm_conf_dump()
1779 zlog(ZLOG_NOTICE, "\tlisten.mode = %s", STR2STR(wp->config->listen_mode)); in fpm_conf_dump()
1780 …zlog(ZLOG_NOTICE, "\tlisten.allowed_clients = %s", STR2STR(wp->config->listen_allowed_clients)… in fpm_conf_dump()
1782 zlog(ZLOG_NOTICE, "\tlisten.setfib = %d", wp->config->listen_setfib); in fpm_conf_dump()
1784 if (wp->config->process_priority == 64) { in fpm_conf_dump()
1787 zlog(ZLOG_NOTICE, "\tprocess.priority = %d", wp->config->process_priority); in fpm_conf_dump()
1789 zlog(ZLOG_NOTICE, "\tprocess.dumpable = %s", BOOL2STR(wp->config->process_dumpable)); in fpm_conf_dump()
1790 zlog(ZLOG_NOTICE, "\tpm = %s", PM2STR(wp->config->pm)); in fpm_conf_dump()
1791 zlog(ZLOG_NOTICE, "\tpm.max_children = %d", wp->config->pm_max_children); in fpm_conf_dump()
1792 zlog(ZLOG_NOTICE, "\tpm.start_servers = %d", wp->config->pm_start_servers); in fpm_conf_dump()
1793 zlog(ZLOG_NOTICE, "\tpm.min_spare_servers = %d", wp->config->pm_min_spare_servers); in fpm_conf_dump()
1794 zlog(ZLOG_NOTICE, "\tpm.max_spare_servers = %d", wp->config->pm_max_spare_servers); in fpm_conf_dump()
1795 zlog(ZLOG_NOTICE, "\tpm.max_spawn_rate = %d", wp->config->pm_max_spawn_rate); in fpm_conf_dump()
1796 zlog(ZLOG_NOTICE, "\tpm.process_idle_timeout = %d", wp->config->pm_process_idle_timeout); in fpm_conf_dump()
1797 zlog(ZLOG_NOTICE, "\tpm.max_requests = %d", wp->config->pm_max_requests); in fpm_conf_dump()
1798 zlog(ZLOG_NOTICE, "\tpm.status_path = %s", STR2STR(wp->config->pm_status_path)); in fpm_conf_dump()
1799 zlog(ZLOG_NOTICE, "\tpm.status_listen = %s", STR2STR(wp->config->pm_status_listen)); in fpm_conf_dump()
1800 zlog(ZLOG_NOTICE, "\tping.path = %s", STR2STR(wp->config->ping_path)); in fpm_conf_dump()
1801 zlog(ZLOG_NOTICE, "\tping.response = %s", STR2STR(wp->config->ping_response)); in fpm_conf_dump()
1802 zlog(ZLOG_NOTICE, "\taccess.log = %s", STR2STR(wp->config->access_log)); in fpm_conf_dump()
1803 zlog(ZLOG_NOTICE, "\taccess.format = %s", STR2STR(wp->config->access_format)); in fpm_conf_dump()
1804 for (kv = wp->config->access_suppress_paths; kv; kv = kv->next) { in fpm_conf_dump()
1807 zlog(ZLOG_NOTICE, "\tslowlog = %s", STR2STR(wp->config->slowlog)); in fpm_conf_dump()
1808 zlog(ZLOG_NOTICE, "\trequest_slowlog_timeout = %ds", wp->config->request_slowlog_timeout); in fpm_conf_dump()
1809 zlog(ZLOG_NOTICE, "\trequest_slowlog_trace_depth = %d", wp->config->request_slowlog_trace_depth); in fpm_conf_dump()
1810 zlog(ZLOG_NOTICE, "\trequest_terminate_timeout = %ds", wp->config->request_terminate_timeout); in fpm_conf_dump()
1811 …zlog(ZLOG_NOTICE, "\trequest_terminate_timeout_track_finished = %s", BOOL2STR(wp->config->request_… in fpm_conf_dump()
1812 zlog(ZLOG_NOTICE, "\trlimit_files = %d", wp->config->rlimit_files); in fpm_conf_dump()
1813 zlog(ZLOG_NOTICE, "\trlimit_core = %d", wp->config->rlimit_core); in fpm_conf_dump()
1814 zlog(ZLOG_NOTICE, "\tchroot = %s", STR2STR(wp->config->chroot)); in fpm_conf_dump()
1815 zlog(ZLOG_NOTICE, "\tchdir = %s", STR2STR(wp->config->chdir)); in fpm_conf_dump()
1816 …zlog(ZLOG_NOTICE, "\tcatch_workers_output = %s", BOOL2STR(wp->config->catch_workers_output)); in fpm_conf_dump()
1817 …zlog(ZLOG_NOTICE, "\tdecorate_workers_output = %s", BOOL2STR(wp->config->decorate_workers_outpu… in fpm_conf_dump()
1818 zlog(ZLOG_NOTICE, "\tclear_env = %s", BOOL2STR(wp->config->clear_env)); in fpm_conf_dump()
1819 zlog(ZLOG_NOTICE, "\tsecurity.limit_extensions = %s", wp->config->security_limit_extensions); in fpm_conf_dump()
1821 for (kv = wp->config->env; kv; kv = kv->next) { in fpm_conf_dump()
1825 for (kv = wp->config->php_values; kv; kv = kv->next) { in fpm_conf_dump()
1829 for (kv = wp->config->php_admin_values; kv; kv = kv->next) { in fpm_conf_dump()
1887 for (struct fpm_worker_pool_s *wp = fpm_worker_all_pools; wp; wp = wp->next) { in fpm_conf_init_main() local
1888 if (!fpm_unix_test_config(wp)) { in fpm_conf_init_main()