httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Stoddard <b...@wstoddard.com>
Subject [PATCH] Win32: install service in rewrite args rather than post_config?
Date Fri, 11 Feb 2005 17:57:01 GMT
If I try apache -k install -n foo, the install for service foo will fail if there are any problems
in 
httpd.conf (invalid directives, syntax errors, or if the listener port is already active).
While I see some 
value in failing the install of the service based on httpd.conf, overall I think's its more
of a pain than a 
benefit. This patch moves the install of the service out of the post_config hook and into
the rewrite_args 
hook (same hook where the -k uninstall code lives, Arguably service install/uninstall handling
should be moved 
to the pre_config hook ).  Comments?


C:\home\apache\20\httpd-2.0\server\mpm\winnt>svn diff mpm_winnt.c
svn diff mpm_winnt.c
Index: mpm_winnt.c
===================================================================
--- mpm_winnt.c	(revision 149412)
+++ mpm_winnt.c	(working copy)
@@ -1070,7 +1070,7 @@
      /* Handle the following SCM aspects in this phase:
       *
       *   -k runservice [transition for WinNT, nothing for Win9x]
-     *   -k (!)install [error out if name is not installed]
+     *   -k install
       *   -k uninstall
       *   -k stop
       *   -k shutdown (same as -k stop). Maintained for backward compatability.
@@ -1279,6 +1279,12 @@
                   "%s: Service is already installed.", service_name);
              exit(APEXIT_INIT);
          }
+        else
+        {
+            /* Install the service */
+            rv = mpm_service_install(process->pool, inst_argc, inst_argv, 0);
+            exit(rv);
+        }
      }
      else if (running_as_service)
      {
@@ -1386,7 +1392,6 @@

      /* Handle the following SCM aspects in this phase:
       *
-     *   -k install
       *   -k config
       *   -k start
       *   -k restart
@@ -1399,12 +1404,6 @@
       * these options to fail unexpectedly in another process.
       */

-    if (!strcasecmp(signal_arg, "install")) {
-        rv = mpm_service_install(ptemp, inst_argc, inst_argv, 0);
-        apr_pool_destroy(s->process->pool);
-        apr_terminate();
-        exit(rv);
-    }
      if (!strcasecmp(signal_arg, "config")) {
          rv = mpm_service_install(ptemp, inst_argc, inst_argv, 1);
          apr_pool_destroy(s->process->pool);

Mime
View raw message