Project

General

Profile

Actions

Bug #2502

closed

fastcgi process became a orphan process

Added by silence over 11 years ago. Updated about 11 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
ASK QUESTIONS IN Forums:

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


Files

lighttpd_SIGTERM.strace (27.5 KB) lighttpd_SIGTERM.strace send SIGTERM to stop lighttpd when spawning fastcgi process silence, 2013-08-06 11:07
lighttpd_notmal.strace (167 KB) lighttpd_notmal.strace send SIGTERM to stop lighttpd when lighttpd is already started silence, 2013-08-06 11:07
Actions #1

Updated by stbuehler over 11 years ago

  • Status changed from New to Need Feedback

show us a strace of lighttpd that proves your statement.

Updated by silence over 11 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.

Actions #3

Updated by stbuehler over 11 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
Actions #4

Updated by stbuehler over 11 years ago

  • Target version set to 1.4.33
Actions #5

Updated by stbuehler about 11 years ago

  • Status changed from Need Feedback to Assigned
Actions #6

Updated by stbuehler about 11 years ago

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

Applied in changeset r2901.

Actions

Also available in: Atom