https://redmine.lighttpd.net/https://redmine.lighttpd.net/favicon.ico?13667327412009-07-13T12:09:20Zlighty labsLighttpd - Bug #2029: mod_fastcgi and spawn-fcgi USR1 signal handlinghttps://redmine.lighttpd.net/issues/2029?journal_id=61672009-07-13T12:09:20Zstbuehler
<ul></ul><p>lighttpd ignores SIG_USR1, which is inherited trough exec():</p>
<p><a class="external" href="http://www.opengroup.org/onlinepubs/000095399/functions/exec.html">http://www.opengroup.org/onlinepubs/000095399/functions/exec.html</a>:</p>
<blockquote>
<p>Except for SIGCHLD, signals set to be ignored (SIG_IGN) by the calling process image shall be set to be ignored by the new process image.</p>
</blockquote>
<p>I guess resetting the ignored signals to the default behaviour should fix this.</p> Lighttpd - Bug #2029: mod_fastcgi and spawn-fcgi USR1 signal handlinghttps://redmine.lighttpd.net/issues/2029?journal_id=61702009-07-13T13:45:04Zstbuehler
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Fixed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset r2582.</p> Lighttpd - Bug #2029: mod_fastcgi and spawn-fcgi USR1 signal handlinghttps://redmine.lighttpd.net/issues/2029?journal_id=61762009-07-13T14:23:08Zkapouer
<ul></ul><p>i applied changeset r2582 to lighttpd 1.4.23,<br />the spawned process still doesn't respond to SIGUSR1<br />and stopping lighttpd doesn't stop the spawned process.</p> Lighttpd - Bug #2029: mod_fastcgi and spawn-fcgi USR1 signal handlinghttps://redmine.lighttpd.net/issues/2029?journal_id=61772009-07-13T14:36:14Zstbuehler
<ul></ul><p>Could you please try adding a "setsid();" call before the exec call (where the signal(..) calls were added)?</p> Lighttpd - Bug #2029: mod_fastcgi and spawn-fcgi USR1 signal handlinghttps://redmine.lighttpd.net/issues/2029?journal_id=61782009-07-13T14:36:27Zstbuehler
<ul><li><strong>Status</strong> changed from <i>Fixed</i> to <i>Reopened</i></li><li><strong>Target version</strong> set to <i>1.4.24</i></li></ul> Lighttpd - Bug #2029: mod_fastcgi and spawn-fcgi USR1 signal handlinghttps://redmine.lighttpd.net/issues/2029?journal_id=61792009-07-13T14:44:49Zkapouer
<ul></ul><p>unfortunately, no luck with this :<br /><pre>
reset_signals();
setsid();
/* exec the cgi */
execve(arg.ptr[0], arg.ptr, env.ptr);
</pre></p> Lighttpd - Bug #2029: mod_fastcgi and spawn-fcgi USR1 signal handlinghttps://redmine.lighttpd.net/issues/2029?journal_id=61802009-07-13T14:50:08Zkapouer
<ul></ul><p>also note that i got several other spawned processes :<br /><pre>
www-data 27248 1 0 16:47 ? 00:00:00 /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
www-data 27251 27248 1 16:47 ? 00:00:00 /usr/bin/php-cgi
www-data 27255 27251 0 16:47 ? 00:00:00 /usr/bin/php-cgi
www-data 27257 27251 0 16:47 ? 00:00:00 /usr/bin/php-cgi
www-data 27258 27248 32 16:47 ? 00:00:00 /usr/bin/octave -qf /home/dev/WORKSPACES/climelioth/octave/main.m --fcgi
www-data 27259 27248 32 16:47 ? 00:00:00 /usr/bin/octave -qf /home/dev/WORKSPACES/climelioth/octave/main.m --fcgi
www-data 27260 27248 3 16:47 ? 00:00:00 /home/dev/public_html/webkitpdf/webkitpdf-fcgi
www-data 27261 27248 72 16:47 ? 00:00:00 ruby /usr/share/redmine/public/dispatch.fcgi
www-data 27262 27248 69 16:47 ? 00:00:00 ruby /usr/share/redmine/public/dispatch.fcgi
</pre><br />all of them are configured with "kill-signal" => 10,<br />only the ruby ones don't quit.<br />if i stop lighttpd just after i start it (within 3 seconds or less) the ruby processes quit gracefully.<br />if i wait 10 seconds, then they don't. Maybe it's something with ruby, too ?</p> Lighttpd - Bug #2029: mod_fastcgi and spawn-fcgi USR1 signal handlinghttps://redmine.lighttpd.net/issues/2029?journal_id=61812009-07-13T15:17:54Zdarix
<ul></ul><p>well signal 10 is sigbus. not a proper signal to kill your apps. maybe try 15? which would be SIGTERM.</p> Lighttpd - Bug #2029: mod_fastcgi and spawn-fcgi USR1 signal handlinghttps://redmine.lighttpd.net/issues/2029?journal_id=61822009-07-13T15:20:14Zkapouer
<ul></ul><p>not on my debian distrib :</p>
<blockquote>
<p>kill -l USR1</p>
</blockquote>
<p>10</p>
<blockquote>
<p>kill -l BUS</p>
</blockquote>
<p>7</p>
<p>of course i could use kill-signal 9, but that would not be very graceful.</p> Lighttpd - Bug #2029: mod_fastcgi and spawn-fcgi USR1 signal handlinghttps://redmine.lighttpd.net/issues/2029?journal_id=61842009-07-13T16:01:49Zkapouer
<ul></ul><p>it is still buggy with the patch, but something strange is happening :<br />when i start lighttpd, i have two ruby processes launched<br />if i don't use the ruby webapp (here it's redmine), then stop lighttpd, the two instances are not killed.<br />if i use the webapp, browse some pages, then stop lighttpd, ONE instance is killed, not the other.</p> Lighttpd - Bug #2029: mod_fastcgi and spawn-fcgi USR1 signal handlinghttps://redmine.lighttpd.net/issues/2029?journal_id=61852009-07-13T17:42:41Zstbuehler
<ul></ul><p>Could you please check if you still can't kill them manually with kill -USR1 ?</p>
<p>There may have been two problems: 1. ignoring the signal and 2. lighty didn't send a signal</p> Lighttpd - Bug #2029: mod_fastcgi and spawn-fcgi USR1 signal handlinghttps://redmine.lighttpd.net/issues/2029?journal_id=61862009-07-13T18:14:53Zkapouer
<ul></ul><p>i checked again, the answer is no.<br />i tried on the other fastcgi instances, and it works on them.</p>
<p>i also added logs to see if lighttpd was sending the signal,<br />and i can confirm that :<br /><pre>
kill(proc->pid, host->kill_signal);
</pre><br />is called (in mod_fastcgi_free) with the right parameters :<br />i compared the proc->pid with pids of running ruby instances,<br />and also the kill-signal was correct.<br />I guess there is some weird interaction between ruby and the<br />way lighttpd spawns processes compared to the way spawn-fcgi spawns<br />processes.</p> Lighttpd - Bug #2029: mod_fastcgi and spawn-fcgi USR1 signal handlinghttps://redmine.lighttpd.net/issues/2029?journal_id=62072009-07-21T08:33:08Zstbuehler
<ul></ul><p>Looks like there is/was a problem with ruby-fcgi (different behaviour in ruby and c implementation), see <a class="external" href="http://dev.rubyonrails.org/ticket/8704">http://dev.rubyonrails.org/ticket/8704</a> .</p> Lighttpd - Bug #2029: mod_fastcgi and spawn-fcgi USR1 signal handlinghttps://redmine.lighttpd.net/issues/2029?journal_id=62362009-07-24T20:04:00Zstbuehler
<ul><li><strong>Status</strong> changed from <i>Reopened</i> to <i>Invalid</i></li></ul><p>Let me summarize:<br />- lighty resets default signal behaviour (so it should be the same as spawn-fcgi)<br />- lighty does the correct kill() call</p>
<p>I don't think that is our problem, sry. (As it works with spawn-fcgi, just use spawn-fcgi. It is the right thing anyway :) )</p> Lighttpd - Bug #2029: mod_fastcgi and spawn-fcgi USR1 signal handlinghttps://redmine.lighttpd.net/issues/2029?journal_id=62382009-07-24T20:35:33Zstbuehler
<ul><li><strong>Target version</strong> deleted (<del><i>1.4.24</i></del>)</li></ul>