When running httpd under Windows not as a service, there is a known bug
(BZ 25484), that you can't restart or stop it from another commandline
(DOS box).

This worked in httpd 1.3, never worked in 2.x and is still documented as
working.

Most of the code needed to make it work is already there, and I wrote a
little fix for this issue. Before adding it to trunk, we need to decide
on a good way to express the functionality on the commandline.

At the moment, when starting without service, one uses either
"bin\httpd" (uses default config file) or adds "-f" and "-d" arguments
as wanted, or "-n NAME" to retrieve "-f" and "-d" from the service
definition. Whenever there is no "-k start" used, the process will not
be started as a service and not detach from the terminal, even when the
config data is retrieved from a service definition in the registry (via
"-n NAME").

The only way to stop or restart at the moment has the syntax "-k stop"
(or "-k shutdown") and -k "restart". This will always try to stop or
restart a service and not work for a non-service instance.

To stop a non-service httpd, one could request to always add a "-f"
parameter (since it is useless for existing uses of "-k start" and "-k
restart"), but I don't like the idea, because

- some lazy people will already have a -f in their script
  even though for "-k stop" it's not used
- the syntax "-k stop -n NAME" should also work for the
  non-service case, like you can add "-n NAME" when
  starting a non-service.

So I propose an additional flag to tell httpd, that it should not use
the service interface for the requested operation. The flag could be
used optionally in combination with "-k start", "-k stop", "-k
shutdown", and "-k restart". In the start case, the code will do the
same as it does right now, when no "-k" is given at all, in the other
cases it will use the given httpd.conf (via relative path, overwritten
by -d, -f or a service name), retrieve the pid file name, read the pid
from the file and signal the running httpd. That's the part I already
have working.

Prize question: what's a good flag? A lot of flags are already used for
other purposes, available are (in 2.2.x, didn't yet check trunk): a, b,
g, i, j, m, o, p, q, r, s, u, x, y, z and the upper case letters A, B,
F-K, N-R, T, U, W-Z. Letter c/C (console or commandline) and t/T
(terminal) are already taken.

Any suggestions?

Any comments on this change at all? Note that it will not break any use
case, that already works.

Regards,

Rainer

Reply via email to