Changeset 1745

Show
Ignore:
Timestamp:
04/10/2007 05:08:11 PM (17 months ago)
Author:
darix
Message:

- added "kill-signal" as setting for fastcgi blocks. applications

linking libfcgi should be killed with SIGUSR1. The default value will
remain SIGTERM though. If you want to change it add:
'"kill-signal" => 10,' in your fastcgi block.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.4.x/src/mod_fastcgi.c

    r1741 r1745  
    251251 
    252252        buffer *strip_request_uri; 
     253 
     254        unsigned short kill_signal; /* we need a setting for this as libfcgi 
     255                                       applications prefer SIGUSR1 while the 
     256                                       rest of the world would use SIGTERM 
     257                                       *sigh* */ 
    253258} fcgi_extension_host; 
    254259 
     
    652657                                        for (proc = host->first; proc; proc = proc->next) { 
    653658                                                if (proc->pid != 0) { 
    654                                                         /* libfcgi wants SIGUSR1 for killing */ 
    655                                                         kill(proc->pid, SIGUSR1); 
    656                                                         kill(proc->pid, SIGTERM); 
     659                                                        kill(proc->pid, host->kill_signal); 
    657660                                                } 
    658661 
     
    665668                                        for (proc = host->unused_procs; proc; proc = proc->next) { 
    666669                                                if (proc->pid != 0) { 
    667                                                         /* libfcgi wants SIGUSR1 for killing */ 
    668                                                         kill(proc->pid, SIGUSR1); 
    669                                                         kill(proc->pid, SIGTERM); 
     670                                                        kill(proc->pid, host->kill_signal); 
    670671                                                } 
    671672                                                if (proc->is_local && 
     
    10331034                                                        "in the output, NOT (cgi) NOR (cli)\n" 
    10341035                                                        "For more information check http://www.lighttpd.net/documentation/fastcgi.html#preparing-php-as-a-fastcgi-program"); 
    1035                                         log_error_write(srv, __FILE__, __LINE__, "s", 
    1036                                                         "If this is PHP on Gentoo add fastcgi to the USE flags"); 
    10371036                                } else if (WIFSIGNALED(status)) { 
    10381037                                        log_error_write(srv, __FILE__, __LINE__, "sd", 
     
    11861185 
    11871186                                                { "broken-scriptfilename", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },  /* 14 */ 
    1188                                                 { "allow-x-send-file", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },      /* 15 */ 
     1187                                                { "allow-x-send-file",  NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },      /* 15 */ 
    11891188                                                { "strip-request-uri",  NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },      /* 16 */ 
     1189                                                { "kill-signal",        NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },      /* 17 */ 
    11901190 
    11911191                                                { NULL,                NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET } 
     
    12141214                                        host->break_scriptfilename_for_php = 0; 
    12151215                                        host->allow_xsendfile = 0; /* handle X-LIGHTTPD-send-file */ 
     1216                                        host->kill_signal = SIGTERM; 
    12161217 
    12171218                                        fcv[0].destination = host->host; 
     
    12341235                                        fcv[15].destination = &(host->allow_xsendfile); 
    12351236                                        fcv[16].destination = host->strip_request_uri; 
     1237                                        fcv[17].destination = &(host->kill_signal); 
    12361238 
    12371239                                        if (0 != config_insert_values_internal(srv, da_host->value, fcv)) {