Windows: Add shutdown event log message
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 20 Jul 2011 18:12:42 +0000 (14:12 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Fri, 22 Jul 2011 15:54:49 +0000 (08:54 -0700)
Add an explicit message that the shutdown sequence is complete.
This is necessary because during a Windows OS shutdown, the service
is frequently killed prior to the memory mapped file is fully released.

Change-Id: I1ad2471e1e1442d836d6abac09fc5cdd08edae0b
Reviewed-on: http://gerrit.openafs.org/5053
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/afsd_eventlog.c
src/WINNT/afsd/afsd_eventmessages.mc
src/WINNT/afsd/afsd_service.c

index 57af3dd..05fec3d 100644 (file)
@@ -206,6 +206,7 @@ LogEvent(WORD wEventType, DWORD dwEventID, ...)
     case MSG_SERVICE_INCORRECT_VERSIONS:
     case MSG_SERVICE_RUNNING:
     case MSG_SERVICE_STOPPING:
+    case MSG_SERVICE_STOPPED:
     case MSG_SERVICE_ERROR_STOP:
     case MSG_CRYPT_OFF:
     case MSG_CRYPT_ON:
index 38d8ce3..0c756af 100644 (file)
@@ -438,4 +438,12 @@ Language=English
 Busy call channel when communicating with server %1, retrying ...
 .
 
+MessageId=
+Severity=Informational
+Facility=System
+SymbolicName=MSG_SERVICE_STOPPED
+Language=English
+OpenAFS Shutdown Complete.
+.
+
 ;#endif /* __AFSD_EVENTMESSAGES_H_ 1 */
index 85bc65f..1fb3fd0 100644 (file)
@@ -1506,6 +1506,8 @@ afsd_Main(DWORD argc, LPTSTR *argv)
     /* Remove the ExceptionFilter */
     SetUnhandledExceptionFilter(NULL);
 
+    LogEvent(EVENTLOG_INFORMATION_TYPE, MSG_SERVICE_STOPPED);
+
     if (bRunningAsService) {
         ServiceStatus.dwCurrentState = SERVICE_STOPPED;
         ServiceStatus.dwWin32ExitCode = GlobalStatus ? ERROR_EXCEPTION_IN_SERVICE : NO_ERROR;