Project

General

Profile

Feature #1584

support for xinetd

Added by PeterLeese over 9 years ago. Updated over 1 year ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
core
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Missing in 1.5.x:

Description

Any change of adding support to allow lighttpd to be started from xinted?
Perhaps a command line option that then makes lighttpd take stdin fd as the socket to listen on.

Associated revisions

Revision 1812f554 (diff)
Added by gstrauss over 1 year ago

[core] lighttpd -1 handles single request on stdin socket (fixes #1584)

(e.g. when called from xinetd)

Note: lighttpd is designed as a high performance, long-running server,
not a one-shot executable. This one-shot mode of operation has not been
tuned for performance. lighttpd server start-up and initialization aims
for correctness, not speed. If using this one-shot mode as part of fork
and exec from xinetd, then performance is already not of high concern.

x-ref:
"support for xinetd"
https://redmine.lighttpd.net/issues/1584

Revision 89379011
Added by gstrauss over 1 year ago

lighttpd run modes for idle timeout, one-shot

lighttpd -i <secs> shutdown after idle time limit (fixes #2696)
lighttpd -1 handles single request on stdin socket (fixes #1584)

Merge branch 'feature-2696-idle-shutdown' into master

github: closes #43

History

#1

Updated by admin over 9 years ago

When would you use this?

#2

Updated by PeterLeese over 9 years ago

On a resource limited machine were I like to run only xinetd and only start any other servers when required (which is very infrequent)

OK, I do understand that lighttpd is already very light i.e. is excellent it that respect. I just like the idea of using xinetd to start services on demand as opposed to have lots of rarely used daemons running all the time from boot. I do understand if you decide that this request is not worth the effort; but hey its worth a try.

I'm willing to have a go at creating a patch and submitting if you wish.

#3

Updated by Anonymous over 9 years ago

Would like to run ligthtpd via inetd, too.

-- Joerg

#4

Updated by Anonymous over 9 years ago

I tried to search for any web-server with cgi-support running via xinetd and really can't find anything. There are many use cases it is really usefull. Please add this feature to lighttpd

#5

Updated by Anonymous about 9 years ago

yes this would be very usefull for me!

-- x0rcist

#6

Updated by stbuehler about 9 years ago

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

Perhaps someone will implement this someday. But i don't think so.

And btw: iirc, you have just to communicate over the stdin fd, not to listen/accept on it; there is no server socket.

#7

Updated by stbuehler about 9 years ago

  • Status changed from Fixed to Wontfix
#8

Updated by ewtoombs about 5 years ago

This is a really good idea for lightweight servers, especially embedded ones like routers. It is also nice for people like me who are only using lighttpd to serve some files in a directory, who don't need responsiveness, and who would prefer not to keep so many small daemons like ssh, samba, and lighttpd in memory all the time. All I'm saying is there are plenty of people who would like to run this http daemon with xinetd.

#9

Updated by gstrauss over 1 year ago

  • Description updated (diff)
  • Status changed from Wontfix to Patch Pending
  • Target version changed from 1.5.0 to 1.4.40

I submitted a patch to add lighttpd -1 (one-shot) mode of operation for use with xinetd:
https://github.com/lighttpd/lighttpd1.4/pull/43

From the commit message:
Note: lighttpd is designed as a high performance, long-running server,
not a one-shot executable. This one-shot mode of operation has not been
tuned for performance. lighttpd server start-up and initialization aims
for correctness, not speed. If using this one-shot mode as part of fork
and exec from xinetd, then performance is already not of high concern.

Aside: sorry, this patch does not quite work with netcat. xinetd provides the connected socket on stdin, whereas netcat uses pipes to stdin and stdout. The current lighttpd architecture expects the client connection to be a socket. Changing that would require changing code on the critical path to serving existing connections, all of which are sockets. Therefore, this has not been done, though I am willing to discuss it if someone has a use case where they think lighttpd just must be used with netcat (instead of some other simpler mechanism or web daemon).

#10

Updated by gstrauss over 1 year ago

  • Status changed from Patch Pending to Fixed
  • % Done changed from 0 to 100

Also available in: Atom