void apache_init (void) { if (!apache_cmd ("start")) { fprintf (stderr, "Could not start apache\n"); exit (1); } apache_running = TRUE; }
void apache_init (void) { if (!apache_cmd ("start")) { g_printerr ("Could not start apache\n"); exit (1); } apache_running = TRUE; }
void apache_cleanup (void) { pid_t pid; char *contents; if (g_file_get_contents ("httpd.pid", &contents, NULL, NULL)) { pid = strtoul (contents, NULL, 10); g_free (contents); } else pid = 0; if (!apache_cmd ("graceful-stop")) return; apache_running = FALSE; if (pid) { while (kill (pid, 0) == 0) g_usleep (100); } }