コード例 #1
0
/* Sometimes, httpd becomes inaccessible, try to re-run it */
httpd_processcheck(void)
{
	int httpd_is_missing = !pids("httpd");

	if (httpd_is_missing)
		printf("## httpd is gone! ##\n");

#ifndef ASUS_DDNS
	if (httpd_is_missing 
#ifdef HTTPD_CHECK
	    || !httpd_check_v2()
#endif
	)
#else	// 2007.03.27 Yau add for prevent httpd die when doing hostname check
	if (httpd_is_missing
#ifdef HTTPD_CHECK
	    || (/*!nvram_match("httpd_check_ddns", "1") && */!httpd_check_v2())
#endif
	)
#endif
	{
		printf("## restart httpd ##\n");

		stop_httpd();
		sleep(1);
#ifdef HTTPD_CHECK
		if (pids("httpdcheck"))
			system("killall -SIGTERM httpdcheck");
		remove(DETECT_HTTPD_FILE);
#endif
		start_httpd();
	}
}
コード例 #2
0
ファイル: watchdog.c プロジェクト: jing-git/rt-n56u
/* Sometimes, httpd becomes inaccessible, try to re-run it */
static void httpd_process_check(void)
{
    int httpd_is_run = pids("httpd");

    if (!httpd_is_run)
        httpd_missing++;
    else
        httpd_missing = 0;

    if (httpd_missing == 1)
        return;

    if (!httpd_is_run
#ifdef HTTPD_CHECK
            || !httpd_check_v2()
#endif
       )
    {
        printf("## restart httpd ##\n");
        httpd_missing = 0;
        stop_httpd();
#ifdef HTTPD_CHECK
        system("killall -9 httpd");
        sleep(1);
        remove(DETECT_HTTPD_FILE);
#endif
        start_httpd(0);
    }
}
コード例 #3
0
ファイル: watchdog.c プロジェクト: eckyecky/rt-n56u
/* Sometimes, httpd becomes inaccessible, try to re-run it */
static void httpd_processcheck(void)
{
	int httpd_is_missing = !pids("httpd");

	if (httpd_is_missing 
#ifdef HTTPD_CHECK
	    || !httpd_check_v2()
#endif
	)
	{
		printf("## restart httpd ##\n");
		stop_httpd();
#ifdef HTTPD_CHECK
		system("killall -9 httpd");
		sleep(1);
		remove(DETECT_HTTPD_FILE);
#endif
		start_httpd(0);
	}
}