Пример #1
0
int governor_init_lve() {
	if (init_lve) {
		if (lve == NULL) {
			lve = init_lve(malloc, NULL);
		}
	}
	if (lve == NULL) {
		return -1;
	}
	init_bad_users_list_client();
	return 0;
}
Пример #2
0
int lscgid_main(int fd, char *argv0, const char *secret, char *pSock)
{
    int ret;

    s_parent = getppid();
    my_signal(SIGCHLD, sigchild);
    my_signal(SIGINT, sigterm);
    my_signal(SIGTERM, sigterm);
    my_signal(SIGHUP, sigusr1);
    my_signal(SIGUSR1, sigusr1);
    signal(SIGPIPE, SIG_IGN);
    s_uid = geteuid();

    memcpy(s_pSecret, secret, 16);

#ifdef HAS_CLOUD_LINUX

#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
    if ((pSock = getenv("LVE_ENABLE")) != NULL)
    {
        s_enable_lve = atol(pSock);
        unsetenv("LVE_ENABLE");
        pSock = NULL;
    }
    if (s_enable_lve && !s_uid)
    {
        load_lve_lib();
        if (s_enable_lve)
            init_lve();

    }
#endif

#endif

#if defined(__FreeBSD__)
    //setproctitle( "%s", "httpd" );
#else
    memset(argv0, 0, strlen(argv0));
    strcpy(argv0, "openlitespeed (lscgid)");
#endif

    ret = run(fd);
    if ((ret) && (pSock) && (strncasecmp(pSock, "uds:/", 5) == 0))
    {
        pSock += 5;
        close(STDIN_FILENO);
        unlink(pSock);
    }
    return ret;
}