Project

General

Profile

Bug #2502

fastcgi process became a orphan process

Added by silence about 3 years ago. Updated about 3 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
core
Target version:
Start date:
2013-08-06
Due date:
% Done:

100%

Missing in 1.5.x:
No

Description

When lighttpd is starting, mod_fastcgi spawns every fastcgi process.
If users stop the lighttpd when fastcgi is spawning..the spawned fastcgi processes became orphan processes..

Because the lighttpd haven't registered signal handler function before spawning fastcgi process. Once the lighttpd received SIGINT or SIGTERM, the lighttpd process will exit immediately without notifying fastcgi processes

lighttpd_SIGTERM.strace - send SIGTERM to stop lighttpd when spawning fastcgi process (27.5 KB) silence, 2013-08-06 11:07

lighttpd_notmal.strace - send SIGTERM to stop lighttpd when lighttpd is already started (167 KB) silence, 2013-08-06 11:07

Associated revisions

Revision 29ff92d9 (diff)
Added by stbuehler about 3 years ago

[core] set signal handlers before forking child processes in modules/plugins_call_set_defaults (fixes #2502)

From: Stefan Bühler <>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2901 152afb58-edef-0310-8abb-c4023f1b3aa9

Revision 2901 (diff)
Added by stbuehler about 3 years ago

[core] set signal handlers before forking child processes in modules/plugins_call_set_defaults (fixes #2502)

From: Stefan Bühler <>

History

#1 Updated by stbuehler about 3 years ago

  • Status changed from New to Need Feedback

show us a strace of lighttpd that proves your statement.

#2 Updated by silence about 3 years ago

I uploaded 2 strace files:
1) lighttpd_SIGTERM.strace

send SIGTERM to stop lighttpd when spawning fastcgi process

2) lighttpd_normal.strace

send SIGTERM to stop lighttpd when lighttpd is already started

--------------------------------------------------------------------------------
The signal_handler function is not registered when spawning fastcgi process:

[server.c]
line 937 plugins_call_set_defaults()
           -> mod_fastcgi spawns fastcgi process

line 993 register signal by sigaction() till this line.

#3 Updated by stbuehler about 3 years ago

Ok, thx. I'll have a closer look :)

Just two things for your setup (unrelated to the bug):

  • don't put sockets in /tmp - another user could create sockets in /tmp with the same names, and lighttpd would connect to them. use a directory that is only writable by lighttpd, if you spawn with lighttpd
  • your max-procs settings look very high. In such large setups it is probably worth the effort to use spawn-fcgi, perhaps combined with multiwatch

#4 Updated by stbuehler about 3 years ago

  • Target version set to 1.4.33

#5 Updated by stbuehler about 3 years ago

  • Status changed from Need Feedback to Assigned

#6 Updated by stbuehler about 3 years ago

  • Status changed from Assigned to Fixed
  • % Done changed from 0 to 100

Applied in changeset r2901.

Also available in: Atom