1 /* $Id: fpm_conf.h,v 1.12.2.2 2008/12/13 03:46:49 anight Exp $ */ 2 /* (c) 2007,2008 Andrei Nigmatulin */ 3 4 #ifndef FPM_CONF_H 5 #define FPM_CONF_H 1 6 7 #include <stdint.h> 8 #include "php.h" 9 10 #define PM2STR(a) (a == PM_STYLE_STATIC ? "static" : (a == PM_STYLE_DYNAMIC ? "dynamic" : "ondemand")) 11 12 #define FPM_CONF_MAX_PONG_LENGTH 64 13 14 struct key_value_s; 15 16 struct key_value_s { 17 struct key_value_s *next; 18 char *key; 19 char *value; 20 }; 21 22 /* 23 * Please keep the same order as in fpm_conf.c and in php-fpm.conf.in 24 */ 25 struct fpm_global_config_s { 26 char *pid_file; 27 char *error_log; 28 #ifdef HAVE_SYSLOG_H 29 char *syslog_ident; 30 int syslog_facility; 31 #endif 32 int log_level; 33 int emergency_restart_threshold; 34 int emergency_restart_interval; 35 int process_control_timeout; 36 int process_max; 37 int process_priority; 38 int daemonize; 39 int rlimit_files; 40 int rlimit_core; 41 char *events_mechanism; 42 #ifdef HAVE_SYSTEMD 43 int systemd_watchdog; 44 int systemd_interval; 45 #endif 46 }; 47 48 extern struct fpm_global_config_s fpm_global_config; 49 50 /* 51 * Please keep the same order as in fpm_conf.c and in php-fpm.conf.in 52 */ 53 struct fpm_worker_pool_config_s { 54 char *name; 55 char *prefix; 56 char *user; 57 char *group; 58 char *listen_address; 59 int listen_backlog; 60 /* Using chown */ 61 char *listen_owner; 62 char *listen_group; 63 char *listen_mode; 64 char *listen_allowed_clients; 65 int process_priority; 66 int process_dumpable; 67 int pm; 68 int pm_max_children; 69 int pm_start_servers; 70 int pm_min_spare_servers; 71 int pm_max_spare_servers; 72 int pm_process_idle_timeout; 73 int pm_max_requests; 74 char *pm_status_path; 75 char *ping_path; 76 char *ping_response; 77 char *access_log; 78 char *access_format; 79 char *slowlog; 80 int request_slowlog_timeout; 81 int request_terminate_timeout; 82 int rlimit_files; 83 int rlimit_core; 84 char *chroot; 85 char *chdir; 86 int catch_workers_output; 87 int clear_env; 88 char *security_limit_extensions; 89 struct key_value_s *env; 90 struct key_value_s *php_admin_values; 91 struct key_value_s *php_values; 92 #ifdef HAVE_APPARMOR 93 char *apparmor_hat; 94 #endif 95 #ifdef HAVE_FPM_ACL 96 /* Using Posix ACL */ 97 char *listen_acl_users; 98 char *listen_acl_groups; 99 #endif 100 }; 101 102 struct ini_value_parser_s { 103 char *name; 104 char *(*parser)(zval *, void **, intptr_t); 105 intptr_t offset; 106 }; 107 108 enum { 109 PM_STYLE_STATIC = 1, 110 PM_STYLE_DYNAMIC = 2, 111 PM_STYLE_ONDEMAND = 3 112 }; 113 114 int fpm_conf_init_main(int test_conf, int force_daemon); 115 int fpm_worker_pool_config_free(struct fpm_worker_pool_config_s *wpc); 116 int fpm_conf_write_pid(); 117 int fpm_conf_unlink_pid(); 118 119 #endif 120