Project

General

Profile

Actions

Bug #1301

closed

lighty 1.5 spawns a new worker when the main process receives a signal

Added by Anonymous over 16 years ago. Updated over 16 years ago.

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

Description

Hello,

I've set server.max-worker to 4.

The problem is that after a 2 weeks of not restarting lighty, I get 20 running workers due to the nightly kill -HUP from logrotate.


img2:~# ps aux|grep -v grep|grep lighttpd
www-data  9663  0.0  0.0   4732  1728 pts/1    S+   09:46   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data  9664  3.6  0.1  32056  7260 pts/1    Sl+  09:46   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data  9670  3.6  0.1  32300  7672 pts/1    Sl+  09:46   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data  9671  3.8  0.1  30992  6672 pts/1    Sl+  09:46   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data  9717  4.1  0.2  34416 10036 pts/1    Sl+  09:46   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
img2:~# kill -HUP 9664
img2:~# ps aux|grep -v grep|grep lighttpd
www-data  9663  0.0  0.0   4732  1728 pts/1    S+   09:46   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data  9664  3.4  0.2  33000  8584 pts/1    Sl+  09:46   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data  9670  3.3  0.2  32436  8344 pts/1    Sl+  09:46   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data  9671  4.2  0.2  36268 11268 pts/1    Sl+  09:46   0:01 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data  9717  4.6  0.3  38672 14184 pts/1    Sl+  09:46   0:01 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
img2:~# kill -HUP 9663
img2:~# ps aux|grep -v grep|grep lighttpd
www-data  9663  0.0  0.0   4732  1728 pts/1    S+   09:46   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data  9664  3.4  0.2  33028  8612 pts/1    Sl+  09:46   0:01 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data  9670  3.3  0.2  32320  8300 pts/1    Sl+  09:46   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data  9671  4.3  0.2  36356 11548 pts/1    Sl+  09:46   0:01 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data  9717  4.6  0.3  37308 12924 pts/1    Sl+  09:46   0:01 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data  9955  0.0  0.0  25688  1512 pts/1    Sl+  09:46   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf

-- lighty

Actions #1

Updated by jan over 16 years ago

  • Status changed from New to Fixed
  • Resolution set to fixed

fixed in r1905

Actions #2

Updated by Anonymous over 16 years ago

  • Status changed from Fixed to Need Feedback
  • Resolution deleted (fixed)

Thank you for your quick patch, but are you sure about that code?
AFAIR wait() returns the pid of the dead process, not 0 on success.

The HUP problem is fixed though.

Simulating a crash of a worker:


img3:~# ps aux|grep -v grep|grep ligh
www-data 29779  0.0  0.0   4800  1728 pts/1    S+   11:28   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data 29780  0.5  0.0  26892  2968 pts/1    Sl+  11:28   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data 29839  0.5  0.0  26900  2992 pts/1    Sl+  11:28   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data 29849  0.8  0.0  27460  3600 pts/1    Sl+  11:28   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data 29984  0.5  0.0  27024  3148 pts/1    Sl+  11:28   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
img3:~# kill -SEGV 29984
img3:~# ps aux|grep -v grep|grep ligh
www-data 29779  0.0  0.0   4800  1740 pts/1    S+   11:28   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data 29780  0.5  0.0  27452  3476 pts/1    Sl+  11:28   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data 29839  0.6  0.1  29576  4716 pts/1    Sl+  11:28   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
www-data 29849  0.8  0.1  29352  4480 pts/1    Sl+  11:28   0:00 /opt/lighttpd/sbin/lighttpd -D -f /opt/lighttpd/etc/lighttpd.conf
img3:~# 

-- lighty

Actions #3

Updated by jan over 16 years ago

  • Status changed from Need Feedback to Fixed
  • Resolution set to fixed

thanks for the heads up, fixed in r1910

Actions

Also available in: Atom