Ticket #1716 (closed defect: fixed)
mod_scgi process spawning without replacing fd=0 (stdin) by socket as in fcgi
| Reported by: | artyomtnk@… | Owned by: | jan |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.4.20 |
| Component: | core | Version: | 1.4.19 |
| Severity: | normal | Keywords: | |
| Cc: | Blocked By: | ||
| Need User Feedback: | no | Blocking: |
Description
mod_scgi is quite similar to mod_fastcgi however, it has an important issue:
When scgi process is spawned its stdin fd do not replaced with socket.
Little description: there are two ways to connect to f/scgi process:
1. By predefined socket
2. By opening stdin as an input socket: this method is usually used in
most of cases when lighty spwans fastcgi process.
So operations are:
1. Create socket /tmp/somesock
2. Bind to socket
3. Fork a process
4. Close fd=0 and copy our new socket to fd=0 (stdin) by dup2
5. Exec a process when fd=0 is socket and fastcgi process can call accept(2)
on this fd (part of standard fastcgi method)
However 4th step is not done in case of scgi which makes facility of spawning of several scgi process by web server quite usless (unless I accidentially guess what is the socket should be opened for lighty)

