Opened 15 years ago

Closed 11 years ago

#10701 closed New feature (wontfix)

manage.py runfcgi dies in response to SIGHUP/SIGUSR1, disallows log rotation

Reported by: Robby Dermody Owned by: nobody
Component: Core (Management commands) Version: 1.0
Severity: Normal Keywords: runfcgi, fastcgi, SIGHUP, log rotation
Cc: robbyd@…, Alexander Koshelev, spoof@…, mateusz@… Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Thanks to #6687, daemonized fastcgi processes can now log their stderr and stdout. In our environment we would like to capture these logs, and rotate them (via the standard method of using logrotate). However, from looking in the code, it appears that runfcgi does not support closing/reopening its log file (which would allow logrotate to rotate the log out from under it). Sending a SIGUSR1 or SIGHUP to the master fcgi PID simply kills it instead of causing it to do this. Unless I'm missing something, it looks like the only way to do this at the time is to stop and then restart the processes, which is unacceptable in a production environment.

A necessary patch would handle a SIGUSR1 and/or SIGHUP to close() and then re open() the files specified in errlog and outlog.

I can write a patch if necessary using the python signal module.

Change History (10)

comment:1 by Robby Dermody, 15 years ago

Cc: robbyd@… added

comment:2 by Alexander Koshelev, 15 years ago

Cc: Alexander Koshelev added

comment:3 by Alex Gaynor, 15 years ago

Triage Stage: UnreviewedDesign decision needed

comment:4 by anonymous, 15 years ago

Cc: spoof@… added

comment:5 by munhitsu, 14 years ago

Cc: mateusz@… added

comment:6 by Seth Buntin, 13 years ago

Severity: Normal
Type: New feature

comment:7 by Aymeric Augustin, 12 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:8 by Aymeric Augustin, 12 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:9 by Aymeric Augustin, 11 years ago

Component: Core (Other)Core (Management commands)

comment:10 by Aymeric Augustin, 11 years ago

Resolution: wontfix
Status: newclosed

Development of the fastcgi interface has mostly stopped (not sure why we haven't deprecated it yet).

This is best handled externally by syslog, as explained in http://hynek.me/articles/taking-some-pain-out-of-python-logging/

Note: See TracTickets for help on using tickets.
Back to Top