Ticket #165 (closed defect: fixed)

Opened 3 years ago

Last modified 4 months ago

crash on startup on SIGPIPE

Reported by: Elan Ruusamäe <glen@delfi.ee> Assigned to: glen
Priority: normal Milestone:
Component: core Version: 1.3.14
Severity: normal Keywords: patch
Cc: Blocking:
Need Feedback: 0

Description

lighttpd receives SIGPIPE if it tries to output warning about invalid config directive. if lighttpd is started from output capturing program like initlog, then lighttpd receives SIGPIPE, because lighttpd has daemonized() and after that initlog closes connected STDERR and exits itself.

i believe moving daemonize afterwards the log_error_open() could prevent this problem.

stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=814, ...}) = 0
write(2, "2005-06-29 15:54:19: (server.c.633) WARNING: unknown config-key: index-file.extensions (ignored) \n", 98) = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) @ 0 (0) ---
Process 26854 detached

to reproduce put this into lighttpd/1.3.14 config:

index-file.extensions = (
   "index.html",
)

and start lighttpd from initlog:

strace -s5000 -ff nice -n 0 initlog -c  "lighttpd -f /etc/lighttpd/lighttpd.conf"

Attachments

lighttpd-1.4.15-stderr.patch (1.1 kB) - added by spillgroup on 07/11/2007 02:48:35 PM.

Change History

07/11/2007 02:48:35 PM changed by spillgroup

  • attachment lighttpd-1.4.15-stderr.patch added.

07/11/2007 02:52:32 PM changed by spillgroup

We faced the SIGPIPE problem too and use the attached patch to circumvent the problem. By the time Lighty spawned its child process it shouldn't be writing to stderr anymore, so we call log_error_open() directly AFTER daemonize()'ing.

01/17/2008 12:26:25 PM changed by glen

  • keywords set to patch.
  • owner changed from jan to glen.
  • blocking changed.
  • pending changed.

01/17/2008 12:33:50 PM changed by glen

  • status changed from new to closed.
  • resolution set to fixed.

Changeset [2049] commited


Add/Change #165 (crash on startup on SIGPIPE)




Change Properties
Action