]> granicus.if.org Git - apache/commitdiff
Windows: Can now install/uninstall Apache as a service and start/stop apache via
authorBill Stoddard <stoddard@apache.org>
Mon, 20 Dec 1999 19:52:51 +0000 (19:52 +0000)
committerBill Stoddard <stoddard@apache.org>
Mon, 20 Dec 1999 19:52:51 +0000 (19:52 +0000)
net start and net stop commands. Not extensively tested, so there may be bugs
in this still.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84343 13f79535-47bb-0310-9956-ffa450edef68

Apache.dsp
ApacheCore.def
ApacheCore.dsp
httpd.dsp
libhttpd.def
server/mpm/winnt/mpm_winnt.c

index e9fadf366ebed67121ad9ee49d5e48a7de1dab90..c199b60dcd9831ead5692fa381ec87b78ee94ec0 100644 (file)
@@ -49,7 +49,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 lib\apr\Release\aprlib.lib  CoreR\ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 lib\apr\Release\aprlib.lib CoreR\ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib /nologo /subsystem:console /machine:I386
 
 !ELSEIF  "$(CFG)" == "Apache - Win32 Debug"
 
@@ -73,7 +73,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386
-# ADD LINK32 lib\apr\debug\aprlib.lib  CoreD\ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386
+# ADD LINK32 lib\apr\debug\aprlib.lib CoreD\ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib /nologo /subsystem:console /debug /machine:I386
 
 !ENDIF 
 
@@ -88,26 +88,10 @@ LINK32=link.exe
 
 SOURCE=.\os\win32\main_win32.c
 # End Source File
-# Begin Source File
-
-SOURCE=.\os\win32\registry.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\os\win32\service.c
-# End Source File
 # End Group
 # Begin Group "Header Files"
 
 # PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
-# Begin Source File
-
-SOURCE=.\os\win32\registry.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\os\win32\service.h
-# End Source File
 # End Group
 # Begin Group "Resource Files"
 
index be38416682696a9c45ecdb9dd9638bee3219bfb8..5661ef9be44e198ade6f7ca730f638508ac8e9cb 100644 (file)
@@ -369,9 +369,16 @@ EXPORTS
         regerror @364
         ap_send_error_response @365
        ap_start_shutdown @366
-;        ap_send_signal  @367
-        ap_pid_fname  @368
-        ap_read_config   @369
-       ap_server_pre_read_config  @370
-       ap_server_post_read_config @371
-       ap_setup_prelinked_modules @372
+        send_signal_to_service  @367
+        ap_read_config   @368
+       ap_server_pre_read_config  @369
+       ap_server_post_read_config @370
+       ap_setup_prelinked_modules @371
+       RemoveService @372
+       InstallService @373
+       isValidService @374
+       service_main  @375
+       isProcessService @376
+       ap_registry_get_server_root @377
+       ap_registry_get_service_conf @378
+
index 1bbd21eb9feda105dacad30ed926a2251353c524..2247eeb72fc2d49f10bc3a631fbda41ef826e371 100644 (file)
@@ -44,7 +44,7 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I ".\lib\apr\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "WIN32_LEAN_AND_MEAN" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "WIN32_LEAN_AND_MEAN" /YX /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x809 /d "NDEBUG"
@@ -70,7 +70,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I ".\include" /I ".\lib\apr\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "WIN32_LEAN_AND_MEAN" /FR /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "WIN32_LEAN_AND_MEAN" /FR /YX /FD /c
 # ADD BASE MTL /nologo /D "_DEBUG" /win32
 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x809 /d "_DEBUG"
@@ -222,10 +222,18 @@ SOURCE=.\os\win32\modules.c
 # End Source File
 # Begin Source File
 
+SOURCE=.\os\win32\registry.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\main\rfc1413.c
 # End Source File
 # Begin Source File
 
+SOURCE=.\os\win32\service.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\main\util.c
 # End Source File
 # Begin Source File
index 1bbd21eb9feda105dacad30ed926a2251353c524..2247eeb72fc2d49f10bc3a631fbda41ef826e371 100644 (file)
--- a/httpd.dsp
+++ b/httpd.dsp
@@ -44,7 +44,7 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I ".\lib\apr\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "WIN32_LEAN_AND_MEAN" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "WIN32_LEAN_AND_MEAN" /YX /FD /c
 # ADD BASE MTL /nologo /D "NDEBUG" /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x809 /d "NDEBUG"
@@ -70,7 +70,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I ".\include" /I ".\lib\apr\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "WIN32_LEAN_AND_MEAN" /FR /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I ".\include" /I ".\lib\apr\include" /I ".\os\win32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "WIN32_LEAN_AND_MEAN" /FR /YX /FD /c
 # ADD BASE MTL /nologo /D "_DEBUG" /win32
 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
 # ADD BASE RSC /l 0x809 /d "_DEBUG"
@@ -222,10 +222,18 @@ SOURCE=.\os\win32\modules.c
 # End Source File
 # Begin Source File
 
+SOURCE=.\os\win32\registry.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\main\rfc1413.c
 # End Source File
 # Begin Source File
 
+SOURCE=.\os\win32\service.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\main\util.c
 # End Source File
 # Begin Source File
index be38416682696a9c45ecdb9dd9638bee3219bfb8..5661ef9be44e198ade6f7ca730f638508ac8e9cb 100644 (file)
@@ -369,9 +369,16 @@ EXPORTS
         regerror @364
         ap_send_error_response @365
        ap_start_shutdown @366
-;        ap_send_signal  @367
-        ap_pid_fname  @368
-        ap_read_config   @369
-       ap_server_pre_read_config  @370
-       ap_server_post_read_config @371
-       ap_setup_prelinked_modules @372
+        send_signal_to_service  @367
+        ap_read_config   @368
+       ap_server_pre_read_config  @369
+       ap_server_post_read_config @370
+       ap_setup_prelinked_modules @371
+       RemoveService @372
+       InstallService @373
+       isValidService @374
+       service_main  @375
+       isProcessService @376
+       ap_registry_get_server_root @377
+       ap_registry_get_service_conf @378
+
index 6cac05fc7102a4b403f4bdca63eff5a79955f683..3cad021ef5a06d5a6beb8124e5676c7b62ba9e3b 100644 (file)
@@ -67,7 +67,8 @@
 #include "ap_config.h"
 #include "ap_listen.h"
 #include "mpm_default.h"
-#include "../os/win32/iol_socket.h"
+#include "service.h"
+#include "iol_socket.h"
 #include "winnt.h"
 
 
@@ -1555,11 +1556,7 @@ static int master_main(server_rec *s, HANDLE shutdown_event, HANDLE restart_even
     /* Create child process 
      * Should only be one in this version of Apache for WIN32 
      */
-#if 1
-//    ReportStatusToSCMgr(SERVICE_START_PENDING, NO_ERROR, 3000);
-#else
-//    service_set_status(SERVICE_START_PENDING);
-#endif
+    service_set_status(SERVICE_START_PENDING);
     while (remaining_children_to_start--) {
         if (create_process(pconf, process_handles, process_kill_events, 
                            &current_live_processes) < 0) {
@@ -1569,11 +1566,8 @@ static int master_main(server_rec *s, HANDLE shutdown_event, HANDLE restart_even
             goto die_now;
         }
     }
-#if 1
-//    ReportStatusToSCMgr(SERVICE_RUNNING, NO_ERROR, 3000);
-#else
-//    service_set_status(SERVICE_RUNNING);
-#endif
+    service_set_status(SERVICE_RUNNING);
+
     restart_pending = shutdown_pending = 0;
     
     /* Wait for shutdown or restart events or for child death */
@@ -1769,11 +1763,8 @@ API_EXPORT(int) ap_mpm_run(ap_context_t *_pconf, ap_context_t *plog, server_rec
         setup_signal_names(ap_psprintf(pconf,"ap%d", parent_pid));
         if (!restart) {
             ap_log_pid(pconf, ap_pid_fname);
-#if 1
-//            ReportStatusToSCMgr(SERVICE_START_PENDING, NO_ERROR, 3000);
-#else
-//            service_set_status(SERVICE_START_PENDING);
-#endif
+
+            service_set_status(SERVICE_START_PENDING);
             AMCSocketInitialize();
 //            setup_signal_names(ap_psprintf(pconf,"ap%d", parent_pid));
         
@@ -1827,11 +1818,8 @@ API_EXPORT(int) ap_mpm_run(ap_context_t *_pconf, ap_context_t *plog, server_rec
             CloseHandle(restart_event);
             CloseHandle(shutdown_event);
             AMCSocketCleanup();
-#if 1
-//            ReportStatusToSCMgr(SERVICE_STOPPED, NO_ERROR, 3000);
-#else
-//            service_set_status(SERVICE_STOPPED);
-#endif
+
+            service_set_status(SERVICE_STOPPED);
         }
     }
     return !restart;