Bug 482892 - Passsync service start and stop messages in Windows event viewer are not logged correctly
Passsync service start and stop messages in Windows event viewer are not logg...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Directory Server
Classification: Red Hat
Component: winsync (Show other bugs)
8.1
All Linux
high Severity high
: ---
: ---
Assigned To: Rich Megginson
Chandrasekar Kannan
:
Depends On:
Blocks: 249650 FDS1.2.0
  Show dependency treegraph
 
Reported: 2009-01-28 13:12 EST by Jenny Galipeau
Modified: 2015-01-04 18:36 EST (History)
2 users (show)

See Also:
Fixed In Version: 8.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-04-29 19:09:52 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
windows application event viewer message (8.54 KB, image/png)
2009-01-28 13:13 EST, Jenny Galipeau
no flags Details
diffs (8.79 KB, patch)
2009-02-13 18:54 EST, Rich Megginson
no flags Details | Diff
cvs commit log (744 bytes, text/plain)
2009-02-16 17:21 EST, Rich Megginson
no flags Details
patch2 (2.33 KB, patch)
2009-03-16 19:53 EDT, Rich Megginson
no flags Details | Diff

  None (edit)
Description Jenny Galipeau 2009-01-28 13:12:51 EST
Description of problem:
When you stop and start the Passsync services on the Windows Directory Server - generic passsync services messages are logged and it is not possible to know what event has happened.  Please refer to the attached screenshot. 
Event ID 105 - is the service starting 
Event ID 144 - is the service stopping

Version-Release number of selected component (if applicable):
8.1

How reproducible:
always

Steps to Reproduce:
1. Install passsync on windows ADS
2. Open event viewer
3. Open services control panel and restart passsync
4. View the events logged in the Application event viewer.
  
Actual results:
Events are not specific due to reason supplied in attached screenshot

Expected results:
Service start and stop messages.

Additional info:
Comment 1 Jenny Galipeau 2009-01-28 13:13:23 EST
Created attachment 330266 [details]
windows application event viewer message
Comment 2 Rich Megginson 2009-02-13 17:32:43 EST
arg - looks like whoever coded this didn't finish the job :-( it is taking me forever to wade through this Windows event and resource code to figure out how this is supposed to work . . .
Comment 3 Rich Megginson 2009-02-13 18:54:20 EST
Created attachment 331886 [details]
diffs
Comment 4 Rich Megginson 2009-02-16 17:19:03 EST
Reviewed by: nkinder (Thanks!)
Fix Description: Looks like someone had started to tie in the message catalog/resources, but didn't get far enough.
1) I used rc to compile the .rc file into a .res file - this new .res file is being added to CVS (cvs add -kb)
2) I added dssynchmsg.res to the link line
3) I made sure the passsync.exe main called the Install() method which installs the message catalog where the Event Viewer can find it.  I had to make that code smarter, so it would not attempt to create/install something that was already there.
Platforms tested: Windows 2003 Server
Flag Day: no
Doc impact: no
Comment 5 Rich Megginson 2009-02-16 17:21:08 EST
Created attachment 332137 [details]
cvs commit log
Comment 6 Jenny Galipeau 2009-03-12 10:21:54 EDT
Upon restart of the Password Synchronization service, three events are logged
in the event viewer.

1. The service was stopped.
2. The Password Synchronization Service service was installed.
3. The service was started.

Should not see installed message again.  

Maybe the new passsync.log message "PassSync service initialized" is related to logging this installed message?
Comment 7 Rich Megginson 2009-03-12 10:40:42 EDT
Fix Description: Omit "The Password Synchronization Service service was installed." message at service startup.

Checking in ntservice.cpp;
/cvs/dirsec/winsync/passwordsync/passsync/ntservice.cpp,v  <--  ntservice.cpp
new revision: 1.7; previous revision: 1.6
done


Index: ntservice.cpp
===================================================================
RCS file: /cvs/dirsec/winsync/passwordsync/passsync/ntservice.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ntservice.cpp	16 Feb 2009 22:20:21 -0000	1.6
+++ ntservice.cpp	12 Mar 2009 14:39:40 -0000	1.7
@@ -199,6 +199,7 @@
     // Get the executable file path
     TCHAR szFilePath[_MAX_PATH];
     ::GetModuleFileName(NULL, szFilePath, sizeof(szFilePath)/sizeof(*szFilePath));
+    int didinstall = FALSE;
 
 	// install if not already installed
 	if (!IsInstalled()) {
@@ -229,6 +230,7 @@
 		// clean up
 		::CloseServiceHandle(hService);
 		::CloseServiceHandle(hSCM);
+        didinstall = TRUE;
 	}
 
     // make registry entries to support logging messages
@@ -263,10 +265,12 @@
                     0,
                     REG_DWORD,
                     (CONST BYTE*)&dwData,
-                     sizeof(DWORD));
+                    sizeof(DWORD));
     ::RegCloseKey(hKey);
 
-    LogEvent(EVENTLOG_INFORMATION_TYPE, EVMSG_INSTALLED, m_szServiceName);
+    if (didinstall) {
+        LogEvent(EVENTLOG_INFORMATION_TYPE, EVMSG_INSTALLED, m_szServiceName);
+    }
 
     return TRUE;
 }
Comment 8 Jenny Galipeau 2009-03-16 12:08:37 EDT
fix verified Windows 2003 Enterprise Edition passsync v 1.1.0 newest build
Comment 9 Rich Megginson 2009-03-16 19:53:59 EDT
Created attachment 335457 [details]
patch2
Comment 10 Rich Megginson 2009-03-17 11:39:53 EDT
Resolves: bug 482892
Bug Description: Passsync service start and stop messages in Windows event viewer are not logged correctly
Reviewed by: nkinder (Thanks!)
Fix Description: For some reason, the code was not detecting that the service had already been installed and was installing it again.  We do not need to install the service in this code, that is done in the .msi file now.  I just got rid of that old code.
Platforms tested: Windows 2003 Server
Flag Day: no
Doc impact: no
Comment 11 Rich Megginson 2009-03-17 11:41:06 EDT
Checking in passwordsync/passsync/ntservice.cpp;
/cvs/dirsec/winsync/passwordsync/passsync/ntservice.cpp,v  <--  ntservice.cpp
new revision: 1.8; previous revision: 1.7
done
Comment 12 Rich Megginson 2009-03-17 11:50:37 EDT
*** Bug 489881 has been marked as a duplicate of this bug. ***
Comment 13 Jenny Galipeau 2009-03-18 10:10:04 EDT
fix verified - latest passsync.msi build - version 1.1.0
Comment 14 Chandrasekar Kannan 2009-04-29 19:09:52 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-0455.html

Note You need to log in before you can comment on or make changes to this bug.