JBoss Native SVN: r2543 - trunk/utils/windows/native/service/jbosssvc.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2009-08-18 09:36:15 -0400 (Tue, 18 Aug 2009)
New Revision: 2543
Added:
trunk/utils/windows/native/service/jbosssvc/redhat.ico
Modified:
trunk/utils/windows/native/service/jbosssvc/jboss.c
trunk/utils/windows/native/service/jbosssvc/jboss.rc
Log:
Be verbose on service install
Modified: trunk/utils/windows/native/service/jbosssvc/jboss.c
===================================================================
--- trunk/utils/windows/native/service/jbosssvc/jboss.c 2009-08-12 09:55:59 UTC (rev 2542)
+++ trunk/utils/windows/native/service/jbosssvc/jboss.c 2009-08-18 13:36:15 UTC (rev 2543)
@@ -116,6 +116,7 @@
static char _service_bat[MAX_PATH + 1];
static char _cmd_exe[MAX_PATH + 1];
static BOOL _service_log = FALSE;
+static BOOL _verbose_log = TRUE;
static DWORD _service_auto = SERVICE_AUTO_START;
enum _service_mode_e {
@@ -250,11 +251,6 @@
WORD nStr;
va_list args;
- if (!_service_log && !isError) {
- /* Nothing to log */
- return;
- }
-
va_start(args, szFormat);
vsprintf(szMsg, szFormat, args);
va_end(args);
@@ -263,12 +259,12 @@
nStr = 2;
wErrType = EVENTLOG_ERROR_TYPE;
dwErrId = MSG_ERROR;
- FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL, GetLastError(),
- MAKELANGID(LANG_NEUTRAL, LANG_NEUTRAL),
- (LPSTR) &lpMsgBuf, 0, NULL);
+ FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, GetLastError(),
+ MAKELANGID(LANG_NEUTRAL, LANG_NEUTRAL),
+ (LPSTR) &lpMsgBuf, 0, NULL);
lpszStrings[0] = lpMsgBuf;
lpszStrings[1] = szMsg;
}
@@ -278,22 +274,36 @@
nStr = 1;
lpszStrings[0] = szMsg;
}
- /* Use event logging to log the error.
- */
- hEventSource = RegisterEventSource(NULL, _service_name);
+ if (_service_log) {
+ /* Use event logging to log the error.
+ */
+ hEventSource = RegisterEventSource(NULL, _service_name);
- if (hEventSource != NULL) {
- ReportEvent(hEventSource, // handle of event source
- wErrType, // event type
- 0, // event category
- dwErrId, // event ID
- NULL, // current user's SID
- nStr, // strings in lpszStrings
- 0, // no bytes of raw data
- lpszStrings, // array of error strings
- NULL); // no raw data
- DeregisterEventSource(hEventSource);
+ if (hEventSource != NULL) {
+ ReportEvent(hEventSource, // handle of event source
+ wErrType, // event type
+ 0, // event category
+ dwErrId, // event ID
+ NULL, // current user's SID
+ nStr, // strings in lpszStrings
+ 0, // no bytes of raw data
+ lpszStrings, // array of error strings
+ NULL); // no raw data
+ DeregisterEventSource(hEventSource);
+ }
}
+ else if (_service_mode != mode_run && _verbose_log) {
+ /* Use consle as output
+ */
+ if (isError) {
+ fprintf(stderr, "%s\n%s\n", lpszStrings[1], lpszStrings[0]);
+ fflush(stderr);
+ }
+ else {
+ fprintf(stdout, "%s\n", lpszStrings[0]);
+ fflush(stdout);
+ }
+ }
if (lpMsgBuf)
LocalFree(lpMsgBuf);
}
@@ -1032,6 +1042,9 @@
case 'm':
_service_auto = SERVICE_DEMAND_START;
break;
+ case 'q':
+ _verbose_log = FALSE;
+ break;
default:
ErrorUsage();
break;
Modified: trunk/utils/windows/native/service/jbosssvc/jboss.rc
===================================================================
--- trunk/utils/windows/native/service/jbosssvc/jboss.rc 2009-08-12 09:55:59 UTC (rev 2542)
+++ trunk/utils/windows/native/service/jbosssvc/jboss.rc 2009-08-18 13:36:15 UTC (rev 2543)
@@ -25,7 +25,7 @@
*/
#include <windows.h>
-#define STR_COPYRIGHT "Copyright � 2007 Red Hat Middleware, LLC. " \
+#define STR_COPYRIGHT "Copyright � 2009 Red Hat Middleware, LLC. " \
"or its licensors, as applicable."
#define STR_LICENSE "Distributable under LGPL license. " \
@@ -34,8 +34,8 @@
#define STR_COMPANY "Red Hat�, Inc."
#define STR_TRADEMARK "� Red Hat Inc."
#define STR_PRODUCT "JBoss Service wrapper"
-#define STR_VERISON "1.2.3.0"
-#define CSV_VERISON 1,2,3,0
+#define STR_VERISON "1.2.4.0"
+#define CSV_VERISON 1,2,4,0
#define PRIVATE_BUILD 0
#define PRERELEASE_BUILD 0
Added: trunk/utils/windows/native/service/jbosssvc/redhat.ico
===================================================================
(Binary files differ)
Property changes on: trunk/utils/windows/native/service/jbosssvc/redhat.ico
___________________________________________________________________
Name: svn:mime-type
+ image/x-icon