Lines Matching refs:srvconf

428 	if (srv->srvconf.pid_file && 0 <= pid_fd) {  in remove_pid_file()
431 "ftruncate failed for: %s", srv->srvconf.pid_file->ptr); in remove_pid_file()
438 if (srv->srvconf.pid_file && !srv->srvconf.changeroot) { in remove_pid_file()
439 if (0 != unlink(srv->srvconf.pid_file->ptr)) { in remove_pid_file()
442 "unlink failed for: %s", srv->srvconf.pid_file->ptr); in remove_pid_file()
922 array_get_data_unset(srv->srvconf.feature_flags, in server_graceful_state_bg()
933 if (0 == srv->srvconf.dont_daemonize in server_graceful_state_bg()
980 if (0 == srv->srvconf.max_worker) { in server_graceful_state_bg()
995 if (0 != srv->srvconf.max_worker) in server_graceful_state_bg()
1010 srv->srvconf.pid_file = NULL; in server_graceful_state_bg()
1016 (long long)getpid(), srv->srvconf.max_conns - srv->lim_conns); in server_graceful_state_bg()
1018 if (0 == srv->srvconf.max_worker) { in server_graceful_state_bg()
1060 if (srv->srvconf.changeroot || oneshot_fd || 2 == graceful_shutdown) in server_graceful_state()
1072 srv->srvconf.pid_file = NULL; in server_graceful_state()
1223 srv->srvconf.pid_file = NULL; in server_main_setup_workers()
1276 srv->srvconf.modules_dir = optarg; in server_main_setup()
1293 case 'D': srv->srvconf.dont_daemonize = 1; break; in server_main_setup()
1310 srv->srvconf.dont_daemonize = 1; in server_main_setup()
1311 srv->srvconf.modules_dir = "modules"; in server_main_setup()
1322 if (1 == srv->srvconf.max_worker) in server_main_setup()
1323 srv->srvconf.max_worker = 0; in server_main_setup()
1331 srv->srvconf.pid_file = NULL; in server_main_setup()
1336 srv->srvconf.preflight_check = 1; in server_main_setup()
1337 srv->srvconf.dont_daemonize = 1; in server_main_setup()
1346 if (srv->srvconf.max_conns <= 16 && malloc_top_pad == 524288) in server_main_setup()
1358 srv->srvconf.dont_daemonize = 1; in server_main_setup()
1359 srv->srvconf.pid_file = NULL; in server_main_setup()
1360 if (srv->srvconf.max_worker) { in server_main_setup()
1361 srv->srvconf.max_worker = 0; in server_main_setup()
1388 …if (srv->srvconf.bindhost && buffer_is_equal_string(srv->srvconf.bindhost, CONST_STR_LEN("/dev/std… in server_main_setup()
1476 if (-1 == pid_fd && srv->srvconf.pid_file) { in server_main_setup()
1477 const char *pidfile = srv->srvconf.pid_file->ptr; in server_main_setup()
1521 if (use_rlimit && srv->srvconf.max_fds in server_main_setup()
1522 && (i_am_root || srv->srvconf.max_fds <= rlim.rlim_max)) { in server_main_setup()
1526 rlim.rlim_cur = srv->srvconf.max_fds; in server_main_setup()
1527 if (i_am_root) rlim.rlim_max = srv->srvconf.max_fds; in server_main_setup()
1533 if (srv->srvconf.max_fds > rlim_cur) in server_main_setup()
1534 srv->srvconf.max_fds = rlim_cur; in server_main_setup()
1539 if (0 == srv->srvconf.max_fds) in server_main_setup()
1540 srv->srvconf.max_fds = (rlim.rlim_cur <= 4096) in server_main_setup()
1545 if (use_rlimit && srv->srvconf.enable_cores && getrlimit(RLIMIT_CORE, &rlim) == 0) { in server_main_setup()
1564 if (srv->srvconf.groupname) { in server_main_setup()
1565 if (NULL == (grp = getgrnam(srv->srvconf.groupname->ptr))) { in server_main_setup()
1567 "can't find groupname %s", srv->srvconf.groupname->ptr); in server_main_setup()
1572 if (srv->srvconf.username) { in server_main_setup()
1573 if (NULL == (pwd = getpwnam(srv->srvconf.username->ptr))) { in server_main_setup()
1575 "can't find username %s", srv->srvconf.username->ptr); in server_main_setup()
1613 if (srv->srvconf.username) { in server_main_setup()
1614 initgroups(srv->srvconf.username->ptr, grp->gr_gid); in server_main_setup()
1619 if (srv->srvconf.changeroot) { in server_main_setup()
1622 if (-1 == chroot(srv->srvconf.changeroot->ptr)) { in server_main_setup()
1645 if (srv->srvconf.enable_cores) { in server_main_setup()
1650 if (srv->srvconf.enable_cores) { in server_main_setup()
1659 if (srv->srvconf.enable_cores) { in server_main_setup()
1667 if (0 == srv->srvconf.dont_daemonize && 0 == graceful_restart) { in server_main_setup()
1698 if (!srv->srvconf.preflight_check) { in server_main_setup()
1716 if (srv->srvconf.preflight_check) { in server_main_setup()
1727 if (0 == srv->srvconf.dont_daemonize && -1 != parent_pipe_fd) { in server_main_setup()
1732 if (idle_limit && srv->srvconf.max_worker) { in server_main_setup()
1733 srv->srvconf.max_worker = 0; in server_main_setup()
1739 if (srv->srvconf.max_worker > 0) { in server_main_setup()
1740 int rc = server_main_setup_workers(srv, srv->srvconf.max_worker); in server_main_setup()
1746 srv->max_fds = (int)srv->srvconf.max_fds; in server_main_setup()
1749 srv->ev = fdevent_init(srv->srvconf.event_handler, &srv->max_fds, &srv->cur_fds, srv->errh); in server_main_setup()
1759 if (srv->srvconf.max_conns > srv->max_fds/2) { in server_main_setup()
1763 srv->srvconf.max_conns, srv->max_fds); in server_main_setup()
1764 srv->lim_conns = srv->srvconf.max_conns = srv->max_fds/2; in server_main_setup()
1765 } else if (srv->srvconf.max_conns) { in server_main_setup()
1767 srv->lim_conns = srv->srvconf.max_conns; in server_main_setup()
1770 srv->lim_conns = srv->srvconf.max_conns = srv->max_fds/3; in server_main_setup()
1833 if (0 == srv->srvconf.max_worker) in server_main_setup()
1900 if (0 == srv->srvconf.max_worker) in server_handle_sigalrm()
1923 if (0 == srv->srvconf.max_worker) { in server_handle_sigchld()