Project

General

Profile

lighttpd-1.4-fastcgi-never-respawns.diff

peto, 2009-02-02 22:07

View differences:

src/mod_fastcgi.c (working copy)
2696 2696
		case PROC_STATE_DIED:
2697 2697
			/* local procs get restarted by us,
2698 2698
			 * remote ones hopefully by the admin */
2699
			if (srv->cur_ts <= proc->disabled_until) break;
2699 2700

  
2700
			if (proc->is_local) {
2701
				/* we still have connections bound to this proc,
2702
				 * let them terminate first */
2703
				if (proc->load != 0) break;
2701
			/* we still have connections bound to this proc,
2702
			 * let them terminate first */
2703
			if (proc->load != 0) break;
2704 2704

  
2705
				/* restart the child */
2705
			/* restart the backend */
2706
			if (p->conf.debug) {
2707
				log_error_write(srv, __FILE__, __LINE__, "ssbsdsd",
2708
						"--- fastcgi spawning",
2709
						"\n\tsocket", proc->connection_name,
2710
						"\n\tcurrent:", 1, "/", host->min_procs);
2711
			}
2706 2712

  
2707
				if (p->conf.debug) {
2708
					log_error_write(srv, __FILE__, __LINE__, "ssbsdsd",
2709
							"--- fastcgi spawning",
2710
							"\n\tsocket", proc->connection_name,
2711
							"\n\tcurrent:", 1, "/", host->min_procs);
2712
				}
2713

  
2714
				if (fcgi_spawn_connection(srv, p, host, proc)) {
2715
					log_error_write(srv, __FILE__, __LINE__, "s",
2716
							"ERROR: spawning fcgi failed.");
2717
					return HANDLER_ERROR;
2718
				}
2719
			} else {
2720
				if (srv->cur_ts <= proc->disabled_until) break;
2721

  
2722
				proc->state = PROC_STATE_RUNNING;
2723
				host->active_procs++;
2724

  
2725
				log_error_write(srv, __FILE__, __LINE__,  "sb",
2726
						"fcgi-server re-enabled:",
2727
						proc->connection_name);
2713
			if (fcgi_spawn_connection(srv, p, host, proc)) {
2714
				log_error_write(srv, __FILE__, __LINE__, "s",
2715
						"ERROR: spawning fcgi failed.");
2716
				return HANDLER_ERROR;
2728 2717
			}
2718

  
2729 2719
			break;
2730 2720
		}
2731 2721
	}