hs-http-d - The HammerServer HTTP Daemon
hs-http-d is the HTTP daemon that uses the HammerServer's server-side modules to provide networked access via the HyperText Transfer Protocol. It is a ``forking daemon'' that accepts connections and services requests.
It should not be invoked directly, but instead, the control script hsctl should be used. The control script makes sure that:
All configuration values are passed to hs-http-d,
The process ID that hs-http-d reports back is correctly entered into a stamp file.
hs-http-d accepts its configuration in the format variable=value in either of two ways:
On the command line, by invoking hs-http-d like e.g.:
hs-http-d port=10000
On stdin. After startup, hs-http-d reads stdin until EOF or until a single line that consists of the word END, as in:
echo -e 'port=10000\naeskey=TopSecretKey\nEND' | hs-http-d
The second method is used by the control script hsctl, so that the runtime configuration isn't revealed in the process list. The fact that hs-http-d reads stdin means that each ``manual'' invocation waits for console input. The server only really starts when Control-D is pressed (EOF marker) or when END is entered.
Just before starting up, hs-http-d prints its process ID on stdout. The invoker may pick this up and e.g., store it in a PID stamp file (this is exactly what hsctl does).
Sending one of the signals SIGHUP SIGINT SIGQUIT SIGTERM SIGSTOP SIGUSR1 SIGUSR2 requests a ``graceful shutdown''. Underway requests are serviced, but no new connections are accepted.
Normally hs-http-d is stopped using hsctl stop, and it's not necessary to kill the process ``by hand''.
The tamper-resistant server, the HTTP daemon, all tooling, and the documentation were written by Karel Kubat / karel@e-tunity.com. Copyright (c) 2009 ff. Distributed under GPLV3.