httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@locus.apache.org
Subject cvs commit: apache-1.3/src CHANGES
Date Thu, 14 Dec 2000 14:31:00 GMT
wrowe       00/12/14 06:30:56

  Modified:    src/main http_main.c
               src/os/win32 service.c service.h
               src      CHANGES
  Log:
    WinNT/2K service can be started from the command line with any desired
    args (e.g. Apache -k start -n apache-1.3 -D FOO starts the service with
    the -D FOO option.)  This extends what Apache on Win9x already does,
    even running as a service.  Now all methods and platforms of Apache/Win32
    accept arguments in a similar manner.
  
  Revision  Changes    Path
  1.518     +1 -1      apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.517
  retrieving revision 1.518
  diff -u -r1.517 -r1.518
  --- http_main.c	2000/12/13 22:25:58	1.517
  +++ http_main.c	2000/12/14 14:30:34	1.518
  @@ -6950,7 +6950,7 @@
        * Die if we failed, are on NT, or are not "start"ing the service
        */
       if (service_name && signal_to_send) {
  -        if (send_signal_to_service(service_name, signal_to_send))
  +        if (send_signal_to_service(service_name, signal_to_send, argc, argv))
               clean_parent_exit(0);
           if (isWindowsNT() || strcasecmp(signal_to_send, "start"))
               clean_parent_exit(1);
  
  
  
  1.36      +18 -5     apache-1.3/src/os/win32/service.c
  
  Index: service.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/os/win32/service.c,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- service.c	2000/12/13 22:25:57	1.35
  +++ service.c	2000/12/14 14:30:42	1.36
  @@ -94,7 +94,7 @@
   static void WINAPI service_main_fn(DWORD, LPTSTR *);
   static void WINAPI service_ctrl(DWORD ctrlCode);
   static int ReportStatusToSCMgr(int currentState, int exitCode, int waitHint);
  -static int ap_start_service(SC_HANDLE);
  +static int ap_start_service(SC_HANDLE, DWORD argc, char **argv);
   static int ap_stop_service(SC_HANDLE);
   static int ap_restart_service(SC_HANDLE);
   
  @@ -991,7 +991,8 @@
       return isNT;
   }
   
  -int send_signal_to_service(char *display_name, char *sig) 
  +int send_signal_to_service(char *display_name, char *sig, 
  +                           int argc, char **argv)
   {
       DWORD       service_pid;
       HANDLE      hwnd;
  @@ -1083,7 +1084,19 @@
                        || ((action == restart) 
                               && (globdat.ssStatus.dwCurrentState 
                                       == SERVICE_STOPPED)))
  -                success = ap_start_service(schService);
  +            {
  +                /* start NT service needs service args */
  +                char **args = malloc(argc * sizeof(char*));
  +                int i, j;
  +                for (i = 1, j = 0; i < argc; i++) {
  +                    if ((argv[i][0] == '-') && ((argv[i][1] == 'k') 
  +                                             || (argv[i][1] == 'n')))
  +                        ++i;
  +                    else
  +                        args[j++] = argv[i];
  +                }
  +                success = ap_start_service(schService, j, args);
  +            }
               else if (action == restart)
                   success = ap_restart_service(schService);
           }
  @@ -1163,8 +1176,8 @@
       return FALSE;
   }
   
  -int ap_start_service(SC_HANDLE schService) {
  -    if (StartService(schService, 0, NULL)) {
  +int ap_start_service(SC_HANDLE schService, DWORD argc, char **argv) {
  +    if (StartService(schService, argc, argv)) {
           Sleep(1000);
           while(QueryServiceStatus(schService, &globdat.ssStatus)) {
               if(globdat.ssStatus.dwCurrentState == SERVICE_START_PENDING)
  
  
  
  1.14      +2 -1      apache-1.3/src/os/win32/service.h
  
  Index: service.h
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/os/win32/service.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- service.h	2000/12/13 22:25:57	1.13
  +++ service.h	2000/12/14 14:30:44	1.14
  @@ -81,7 +81,8 @@
   BOOL isValidService(char *display_name);
   void InstallService(char *display_name, char *conf);
   void RemoveService(char *display_name);
  -int send_signal_to_service(char *display_name, char *sig);
  +int send_signal_to_service(char *display_name, char *sig, 
  +                           int argc, char **argv);
   BOOL isWindowsNT(void);
   void ap_start_console_monitor(void);
   void ap_start_child_console(int is_child_of_service);
  
  
  
  1.1608    +6 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1607
  retrieving revision 1.1608
  diff -u -r1.1607 -r1.1608
  --- CHANGES	2000/12/13 22:25:54	1.1607
  +++ CHANGES	2000/12/14 14:30:50	1.1608
  @@ -1,5 +1,11 @@
   Changes with Apache 1.3.15
   
  +  *) WinNT/2K service can be started from the command line with any
  +     desired args (e.g. Apache -k start -n apache-1.3 -D FOO will
  +     start the service with the -D FOO option.)  This extends what
  +     Apache on Win9x already does, even running as a service.
  +     [William Rowe]
  +
     *) WinNT/2K can be started from the Services control panel adding
        whatever args are desired (e.g. -D ARG) in the 'Start Parameters'
        box of the start service dialog.  These will be passed on and
  
  
  

Mime
View raw message