JBoss Native SVN: r2759 - trunk/build/daemon.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2011-04-29 08:37:36 -0400 (Fri, 29 Apr 2011)
New Revision: 2759
Modified:
trunk/build/daemon/buildnat.bat
Log:
use msdos batch comments :D
Modified: trunk/build/daemon/buildnat.bat
===================================================================
--- trunk/build/daemon/buildnat.bat 2011-04-29 12:29:36 UTC (rev 2758)
+++ trunk/build/daemon/buildnat.bat 2011-04-29 12:37:36 UTC (rev 2759)
@@ -46,12 +46,7 @@
pushd %BUILD_HOME%\windows
-# dynamic dll (lib*.dll).
-#call build.bat sdk x86 jboss-native -ssl -cache
-#call build.bat sdk x64 jboss-native -ssl -cache
-#call build.bat sdk i64 jboss-native -ssl -cache
-
-# static dll tcnative-1.dll
+REM static dll tcnative-1.dll
call build.bat sdk static x86 jboss-native -ssl -cache -static
call build.bat sdk static x64 jboss-native -ssl -cache -static
call build.bat sdk static i64 jboss-native -ssl -cache -static
13 years, 8 months
JBoss Native SVN: r2758 - trunk/build/unix.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2011-04-29 08:29:36 -0400 (Fri, 29 Apr 2011)
New Revision: 2758
Modified:
trunk/build/unix/buildbin.jboss-native.windows.sh
Log:
APR_DECLARE_STATIC=1 looks better.
Modified: trunk/build/unix/buildbin.jboss-native.windows.sh
===================================================================
--- trunk/build/unix/buildbin.jboss-native.windows.sh 2011-04-28 14:22:23 UTC (rev 2757)
+++ trunk/build/unix/buildbin.jboss-native.windows.sh 2011-04-29 12:29:36 UTC (rev 2758)
@@ -63,7 +63,7 @@
fi
if $has_static; then
- add_conf="${add_conf} APR_DECLARE_STATIC=true"
+ add_conf="${add_conf} APR_DECLARE_STATIC=1"
fi
mkdir -p ${output_loc}/bin/${output_lib}
13 years, 8 months
JBoss Native SVN: r2757 - trunk/utils/windows/native/service/procrun.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2011-04-28 10:22:23 -0400 (Thu, 28 Apr 2011)
New Revision: 2757
Modified:
trunk/utils/windows/native/service/procrun/NMAKEmgr
trunk/utils/windows/native/service/procrun/NMAKEsvc
Log:
Add -DUNICODE to daemon CFLAGS
Modified: trunk/utils/windows/native/service/procrun/NMAKEmgr
===================================================================
--- trunk/utils/windows/native/service/procrun/NMAKEmgr 2011-04-28 09:20:16 UTC (rev 2756)
+++ trunk/utils/windows/native/service/procrun/NMAKEmgr 2011-04-28 14:22:23 UTC (rev 2757)
@@ -29,6 +29,7 @@
SRCDIR = .
!ENDIF
+CFLAGS = $(CFLAGS) -EHsc -D_UNICODE -DUNICODE
LFLAGS = $(LFLAGS) /version:2.0
LFLAGS = $(LFLAGS) user32.lib gdi32.lib winspool.lib comdlg32.lib comctl32.lib shlwapi.lib netapi32.lib
INCLUDES = -I$(SRCDIR)\include -I$(SRCDIR)\src -I$(SRCDIR)\apps\prunmgr -I$(JAVA_HOME)\include -I$(JAVA_HOME)\include\win32
Modified: trunk/utils/windows/native/service/procrun/NMAKEsvc
===================================================================
--- trunk/utils/windows/native/service/procrun/NMAKEsvc 2011-04-28 09:20:16 UTC (rev 2756)
+++ trunk/utils/windows/native/service/procrun/NMAKEsvc 2011-04-28 14:22:23 UTC (rev 2757)
@@ -33,6 +33,7 @@
LFLAGS = $(LFLAGS) /stack:0x50000
!ENDIF
+CFLAGS = $(CFLAGS) -EHsc -D_UNICODE -DUNICODE
LFLAGS = $(LFLAGS) /version:2.0
LFLAGS = $(LFLAGS) user32.lib gdi32.lib winspool.lib comdlg32.lib comctl32.lib shlwapi.lib netapi32.lib
INCLUDES = -I$(SRCDIR)\include -I$(SRCDIR)\src -I$(SRCDIR)\apps\prunsrv -I$(JAVA_HOME)\include -I$(JAVA_HOME)\include\win32
13 years, 8 months
JBoss Native SVN: r2756 - in trunk/utils/windows/native/service/procrun/apps: prunsrv and 1 other directory.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2011-04-28 05:20:16 -0400 (Thu, 28 Apr 2011)
New Revision: 2756
Modified:
trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.c
trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.h
trunk/utils/windows/native/service/procrun/apps/prunsrv/prunsrv.c
Log:
Sync code with commons-daemon 1.0.5
Modified: trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.c
===================================================================
--- trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.c 2011-04-28 09:13:19 UTC (rev 2755)
+++ trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.c 2011-04-28 09:20:16 UTC (rev 2756)
@@ -1514,7 +1514,7 @@
break;
case WM_COMMAND:
- switch(LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDM_TM_CONFIG:
ShowServiceProperties(hWnd);
break;
@@ -1564,7 +1564,7 @@
}
break;
case WM_TRAYMESSAGE:
- switch(lParam) {
+ switch (lParam) {
case WM_LBUTTONDBLCLK:
ShowServiceProperties(hWnd);
break;
@@ -1701,11 +1701,18 @@
if (!_options[0].dwValue) {
mutex = CreateMutex(NULL, FALSE, _gui_store->szWndMutex);
if ((mutex == NULL) || (GetLastError() == ERROR_ALREADY_EXISTS)) {
- /* Skip sytem error message */
- SetLastError(ERROR_SUCCESS);
- if (!quiet)
- apxDisplayError(TRUE, NULL, 0, apxLoadResourceA(IDS_ALREAY_RUNING, 0),
- lpCmdline->szApplication);
+ HANDLE hOther = FindWindow(_gui_store->szWndClass, NULL);
+ if (hOther) {
+ SetForegroundWindow(hOther);
+ SendMessage(hOther, WM_COMMAND, MAKEWPARAM(IDM_TM_CONFIG, 0), 0);
+ }
+ else {
+ /* Skip sytem error message */
+ SetLastError(ERROR_SUCCESS);
+ if (!quiet)
+ apxDisplayError(TRUE, NULL, 0, apxLoadResourceA(IDS_ALREAY_RUNING, 0),
+ lpCmdline->szApplication);
+ }
goto cleanup;
}
}
Modified: trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.h
===================================================================
--- trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.h 2011-04-28 09:13:19 UTC (rev 2755)
+++ trunk/utils/windows/native/service/procrun/apps/prunmgr/prunmgr.h 2011-04-28 09:20:16 UTC (rev 2756)
@@ -15,7 +15,6 @@
*/
/* ====================================================================
- *
* Contributed by Mladen Turk <mturk(a)apache.org>
* 05 Aug 2003
* ====================================================================
@@ -24,7 +23,6 @@
#ifndef _PRUNMGR_H
#define _PRUNMGR_H
-#undef PRG_VERSION
#define PRG_VERSION "2.0.5.1"
#define CSV_VERSION 2,0,5,1
#define PRG_REGROOT L"JBoss\\JBoss Web 2"
@@ -75,10 +73,11 @@
#define IDC_PPLGPATH 2642
#define IDC_PPLGBPATH 2643
#define IDC_PPLGPREFIX 2644
-#define IDC_PPLGSTDOUT 2645
-#define IDC_PPLGBSTDOUT 2646
-#define IDC_PPLGSTDERR 2647
-#define IDC_PPLGBSTDERR 2648
+#define IDC_PPLGPIDFILE 2645
+#define IDC_PPLGSTDOUT 2646
+#define IDC_PPLGBSTDOUT 2647
+#define IDC_PPLGSTDERR 2648
+#define IDC_PPLGBSTDERR 2649
#define IDD_PROPPAGE_JVM 2660
#define IDC_PPJAUTO 2661
@@ -139,3 +138,4 @@
#define IDS_NOTIMPLEMENTED 3199
#endif /* _PRUNMGR_H */
+
Modified: trunk/utils/windows/native/service/procrun/apps/prunsrv/prunsrv.c
===================================================================
--- trunk/utils/windows/native/service/procrun/apps/prunsrv/prunsrv.c 2011-04-28 09:13:19 UTC (rev 2755)
+++ trunk/utils/windows/native/service/procrun/apps/prunsrv/prunsrv.c 2011-04-28 09:20:16 UTC (rev 2756)
@@ -41,10 +41,12 @@
#define STDERR_FILENO 2
#define ONE_MINUTE (60 * 1000)
-#ifdef WIN64
+#ifdef _WIN64
#define KREG_WOW6432 KEY_WOW64_32KEY
+#define PRG_BITS 64
#else
#define KREG_WOW6432 0
+#define PRG_BITS 32
#endif
typedef struct APX_STDWRAP {
@@ -59,8 +61,11 @@
static LPCWSTR PRSRV_AUTO = L"auto";
static LPCWSTR PRSRV_JAVA = L"java";
static LPCWSTR PRSRV_JVM = L"jvm";
+static LPCWSTR PRSRV_JDK = L"jdk";
+static LPCWSTR PRSRV_JRE = L"jre";
static LPCWSTR PRSRV_MANUAL = L"manual";
static LPCWSTR PRSRV_JBIN = L"\\bin\\java.exe";
+static LPCWSTR PRSRV_PBIN = L"\\bin";
static LPCWSTR PRSRV_SIGNAL = L"SIGNAL";
static LPCWSTR STYPE_INTERACTIVE = L"interactive";
@@ -229,7 +234,10 @@
static HANDLE gPidfileHandle = NULL;
static LPWSTR gPidfileName = NULL;
static BOOL gSignalValid = TRUE;
+static APXJAVA_THREADARGS gRargs;
+static APXJAVA_THREADARGS gSargs;
+
DWORD WINAPI eventThread(LPVOID lpParam)
{
for (;;) {
@@ -251,7 +259,7 @@
* If stderrfile is not specified it will
* go to stdoutfile.
*/
-static BOOL redirectStdStreams(APX_STDWRAP *lpWrapper)
+static BOOL redirectStdStreams(APX_STDWRAP *lpWrapper, LPAPXCMDLINE lpCmdline)
{
BOOL aErr = FALSE;
BOOL aOut = FALSE;
@@ -261,10 +269,14 @@
/* redirect to file or console */
if (lpWrapper->szStdOutFilename) {
if (lstrcmpiW(lpWrapper->szStdOutFilename, PRSRV_AUTO) == 0) {
+ WCHAR lsn[1024];
aOut = TRUE;
+ lstrcpyW(lsn, lpCmdline->szApplication);
+ lstrlocaseW(lsn);
+ lstrcatW(lsn, L"-stdout");
lpWrapper->szStdOutFilename = apxLogFile(gPool,
lpWrapper->szLogPath,
- L"service-stdout",
+ lsn,
NULL, TRUE);
}
/* Delete the file if not in append mode
@@ -278,13 +290,19 @@
*stdout = *lpWrapper->fpStdOutFile;
setvbuf(stdout, NULL, _IONBF, 0);
}
+ else
+ lpWrapper->szStdOutFilename = NULL;
}
if (lpWrapper->szStdErrFilename) {
if (lstrcmpiW(lpWrapper->szStdErrFilename, PRSRV_AUTO) == 0) {
+ WCHAR lsn[1024];
aErr = TRUE;
+ lstrcpyW(lsn, lpCmdline->szApplication);
+ lstrlocaseW(lsn);
+ lstrcatW(lsn, L"-stderr");
lpWrapper->szStdErrFilename = apxLogFile(gPool,
lpWrapper->szLogPath,
- L"service-stderr",
+ lsn,
NULL, TRUE);
}
if (!aErr)
@@ -295,6 +313,8 @@
*stderr = *lpWrapper->fpStdErrFile;
setvbuf(stderr, NULL, _IONBF, 0);
}
+ else
+ lpWrapper->szStdOutFilename = NULL;
}
else if (lpWrapper->fpStdOutFile) {
_dup2(_fileno(lpWrapper->fpStdOutFile), 2);
@@ -330,14 +350,11 @@
static void printVersion(void)
{
-#ifdef _WIN64
- int b = 64;
-#else
- int b = 32;
-#endif
fwprintf(stderr, L"Commons Daemon Service Runner version %S/Win%d (%S)\n",
- PRG_VERSION, b, __DATE__);
- fwprintf(stderr, L"Copyright (c) 2000-2010 The Apache Software Foundation.\n");
+ PRG_VERSION, PRG_BITS, __DATE__);
+ fwprintf(stderr, L"Copyright (c) 2000-2011 The Apache Software Foundation.\n\n"
+ L"For bug reporting instructions, please see:\n"
+ L"<URL:https://issues.apache.org/jira/browse/DAEMON>.");
}
/* Display configuration parameters */
@@ -381,6 +398,11 @@
APXHANDLE hRegistry;
int i = 0;
+ if (!lpCmdline->szApplication) {
+ /* Handle empty service names */
+ apxLogWrite(APXLOG_MARK_WARN "No service name provided");
+ return FALSE;
+ }
SetLastError(ERROR_SUCCESS);
hRegistry = apxCreateRegistryW(gPool, KEY_READ | KREG_WOW6432,
PRG_REGROOT,
@@ -786,6 +808,13 @@
return TRUE;
}
+static int onExitHook(void)
+{
+ apxLogWrite(APXLOG_MARK_DEBUG "On exit hook called ...");
+ reportServiceStatus(SERVICE_STOPPED, NO_ERROR, 0);
+ return 0;
+}
+
/* Executed when the service receives stop event */
static DWORD WINAPI serviceStop(LPVOID lpParameter)
{
@@ -813,24 +842,32 @@
apxLogWrite(APXLOG_MARK_ERROR "Failed creating java %S", _jni_jvmpath);
return 1;
}
- if (!apxJavaInitialize(hWorker, _jni_classpath, _jni_jvmoptions,
- SO_JVMMS, SO_JVMMX, SO_JVMSS, SO_JNIVFPRINTF)) {
- rv = 2;
- apxLogWrite(APXLOG_MARK_ERROR "Failed initializing java %s", _jni_classpath);
- goto cleanup;
- }
- if (!apxJavaLoadMainClass(hWorker, _jni_sclass, _jni_smethod, _jni_sparam)) {
- rv = 2;
- apxLogWrite(APXLOG_MARK_ERROR "Failed loading main %s class %s",
- _jni_rclass, _jni_classpath);
- goto cleanup;
- }
+ gSargs.hJava = hWorker;
+ gSargs.szClassPath = _jni_classpath;
+ gSargs.lpOptions = _jni_jvmoptions;
+ gSargs.dwMs = SO_JVMMS;
+ gSargs.dwMx = SO_JVMMX;
+ gSargs.dwSs = SO_JVMSS;
+ gSargs.bJniVfprintf = SO_JNIVFPRINTF;
+ gSargs.szClassName = _jni_sclass;
+ gSargs.szMethodName = _jni_smethod;
+ gSargs.lpArguments = _jni_sparam;
+ gSargs.szStdErrFilename = NULL;
+ gSargs.szStdOutFilename = NULL;
+
+ if (lstrcmpA(_jni_sclass, "java/lang/System") == 0)
+ _onexit(onExitHook);
/* Create sutdown event */
gShutdownEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
- if (!apxJavaStart(hWorker)) {
+ if (!apxJavaStart(&gSargs)) {
apxLogWrite(APXLOG_MARK_ERROR "Failed starting java");
rv = 3;
}
+ else if (lstrcmpA(_jni_sclass, "java/lang/System") == 0) {
+ reportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 5000);
+ apxLogWrite(APXLOG_MARK_DEBUG "Forcing java jni System.exit worker to finish...");
+ return 0;
+ }
else {
apxLogWrite(APXLOG_MARK_DEBUG "Waiting for java jni stop worker to finish...");
apxJavaWait(hWorker, INFINITE, FALSE);
@@ -841,6 +878,14 @@
else if (SO_STOPMODE) { /* Only in case we have a stop mode */
DWORD nArgs;
LPWSTR *pArgs;
+
+ if (!SO_STOPIMAGE) {
+ apxLogWrite(APXLOG_MARK_ERROR "Missing service ImageFile");
+ if (!_service_mode)
+ apxDisplayError(FALSE, NULL, 0, "Service '%S' is missing the ImageFile",
+ _service_name ? _service_name : L"unknown");
+ return 1;
+ }
/* Redirect process */
hWorker = apxCreateProcessW(gPool,
0,
@@ -971,8 +1016,12 @@
gPidfileName = apxLogFile(gPool, SO_LOGPATH, SO_PIDFILE, NULL, FALSE);
if (GetFileAttributesW(gPidfileName) != INVALID_FILE_ATTRIBUTES) {
/* Pid file exists */
- apxLogWrite(APXLOG_MARK_ERROR "Pid file '%S' exists", gPidfileName);
- return 1;
+ if (!DeleteFileW(gPidfileName)) {
+ /* Delete failed. Either no access or opened */
+ apxLogWrite(APXLOG_MARK_ERROR "Pid file '%S' exists",
+ gPidfileName);
+ return 1;
+ }
}
}
GetSystemTimeAsFileTime(&fts);
@@ -989,20 +1038,20 @@
apxLogWrite(APXLOG_MARK_ERROR "Failed creating java %S", _jni_jvmpath);
return 1;
}
- if (!apxJavaInitialize(gWorker, _jni_classpath, _jni_jvmoptions,
- SO_JVMMS, SO_JVMMX, SO_JVMSS, SO_JNIVFPRINTF)) {
- rv = 2;
- apxLogWrite(APXLOG_MARK_ERROR "Failed initializing java %s", _jni_classpath);
- goto cleanup;
- }
- if (!apxJavaLoadMainClass(gWorker, _jni_rclass, _jni_rmethod, _jni_rparam)) {
- rv = 3;
- apxLogWrite(APXLOG_MARK_ERROR "Failed loading main %s class %s", _jni_rclass, _jni_classpath);
- goto cleanup;
- }
- apxJavaSetOut(gWorker, TRUE, gStdwrap.szStdErrFilename);
- apxJavaSetOut(gWorker, FALSE, gStdwrap.szStdOutFilename);
- if (!apxJavaStart(gWorker)) {
+ gRargs.hJava = gWorker;
+ gRargs.szClassPath = _jni_classpath;
+ gRargs.lpOptions = _jni_jvmoptions;
+ gRargs.dwMs = SO_JVMMS;
+ gRargs.dwMx = SO_JVMMX;
+ gRargs.dwSs = SO_JVMSS;
+ gRargs.bJniVfprintf = SO_JNIVFPRINTF;
+ gRargs.szClassName = _jni_rclass;
+ gRargs.szMethodName = _jni_rmethod;
+ gRargs.lpArguments = _jni_rparam;
+ gRargs.szStdErrFilename = gStdwrap.szStdErrFilename;
+ gRargs.szStdOutFilename = gStdwrap.szStdOutFilename;
+
+ if (!apxJavaStart(&gRargs)) {
rv = 4;
apxLogWrite(APXLOG_MARK_ERROR "Failed to start Java");
goto cleanup;
@@ -1010,6 +1059,13 @@
apxLogWrite(APXLOG_MARK_DEBUG "Java started %s", _jni_rclass);
}
else {
+ if (!SO_STARTIMAGE) {
+ apxLogWrite(APXLOG_MARK_ERROR "Missing service ImageFile");
+ if (!_service_mode)
+ apxDisplayError(FALSE, NULL, 0, "Service '%S' is missing the ImageFile",
+ _service_name ? _service_name : L"unknown");
+ return 1;
+ }
/* Redirect process */
gWorker = apxCreateProcessW(gPool,
0,
@@ -1072,7 +1128,8 @@
FILE_SHARE_READ,
NULL,
CREATE_NEW,
- FILE_ATTRIBUTE_NORMAL,
+ FILE_ATTRIBUTE_NORMAL |
+ FILE_FLAG_DELETE_ON_CLOSE,
NULL);
if (gPidfileHandle != INVALID_HANDLE_VALUE) {
@@ -1221,11 +1278,25 @@
LPWSTR jx = NULL, szJH = SO_JAVAHOME;
if (!szJH)
szJH = apxGetJavaSoftHome(gPool, FALSE);
+ else if (!lstrcmpiW(szJH, PRSRV_JDK)) {
+ /* Figure out the JDK JavaHome */
+ szJH = apxGetJavaSoftHome(gPool, FALSE);
+ }
+ else if (!lstrcmpiW(szJH, PRSRV_JRE)) {
+ /* Figure out the JRE JavaHome */
+ szJH = apxGetJavaSoftHome(gPool, TRUE);
+ }
if (szJH) {
jx = apxPoolAlloc(gPool, (lstrlenW(szJH) + 16) * sizeof(WCHAR));
lstrcpyW(jx, szJH);
lstrcatW(jx, PRSRV_JBIN);
- SO_STARTPATH = szJH;
+ if (!SO_STARTPATH) {
+ /* Use JAVA_HOME/bin as start path */
+ LPWSTR szJP = apxPoolAlloc(gPool, (lstrlenW(szJH) + 8) * sizeof(WCHAR));
+ lstrcpyW(szJP, szJH);
+ lstrcatW(szJP, PRSRV_PBIN);
+ SO_STARTPATH = szJP;
+ }
}
else {
apxLogWrite(APXLOG_MARK_ERROR "Unable to find Java Runtime Environment.");
@@ -1248,11 +1319,25 @@
LPWSTR jx = NULL, szJH = SO_JAVAHOME;
if (!szJH)
szJH = apxGetJavaSoftHome(gPool, FALSE);
+ else if (!lstrcmpiW(szJH, PRSRV_JDK)) {
+ /* Figure out the JDK JavaHome */
+ szJH = apxGetJavaSoftHome(gPool, FALSE);
+ }
+ else if (!lstrcmpiW(szJH, PRSRV_JRE)) {
+ /* Figure out the JRE JavaHome */
+ szJH = apxGetJavaSoftHome(gPool, TRUE);
+ }
if (szJH) {
jx = apxPoolAlloc(gPool, (lstrlenW(szJH) + 16) * sizeof(WCHAR));
lstrcpyW(jx, szJH);
lstrcatW(jx, PRSRV_JBIN);
- SO_STOPPATH = szJH;
+ if (!SO_STOPPATH) {
+ LPWSTR szJP = apxPoolAlloc(gPool, (lstrlenW(szJH) + 8) * sizeof(WCHAR));
+ lstrcpyW(szJP, szJH);
+ lstrcatW(szJP, PRSRV_PBIN);
+ /* Use JAVA_HOME/bin as stop path */
+ SO_STOPPATH = szJP;
+ }
}
else {
apxLogWrite(APXLOG_MARK_ERROR "Unable to find Java Runtime Environment.");
@@ -1340,7 +1425,7 @@
/* Run the service in the debug mode */
BOOL docmdDebugService(LPAPXCMDLINE lpCmdline)
{
- BOOL rv = FALSE;
+ BOOL rv = TRUE;
_service_mode = FALSE;
_service_name = lpCmdline->szApplication;
@@ -1348,8 +1433,6 @@
serviceMain(0, NULL);
apxLogWrite(APXLOG_MARK_INFO "Debug service finished.");
SAFE_CLOSE_HANDLE(gPidfileHandle);
- if (gPidfileName)
- DeleteFileW(gPidfileName);
return rv;
}
@@ -1365,11 +1448,22 @@
rv = (StartServiceCtrlDispatcherW(_service_table) != 0);
apxLogWrite(APXLOG_MARK_INFO "Run service finished.");
SAFE_CLOSE_HANDLE(gPidfileHandle);
- if (gPidfileName)
- DeleteFileW(gPidfileName);
return rv;
}
+static const char *gSzProc[] = {
+ "",
+ "parse command line arguments",
+ "load configuration",
+ "run service as console application",
+ "run service",
+ "stop service",
+ "update service parameters",
+ "install service",
+ "delete service",
+ NULL
+};
+
void __cdecl main(int argc, char **argv)
{
UINT rv = 0;
@@ -1411,7 +1505,8 @@
apxLogOpen(gPool, SO_LOGPATH, SO_LOGPREFIX);
apxLogLevelSetW(NULL, SO_LOGLEVEL);
apxLogWrite(APXLOG_MARK_DEBUG "Commons Daemon procrun log initialized");
- apxLogWrite(APXLOG_MARK_INFO "Commons Daemon procrun (%s) started", PRG_VERSION);
+ apxLogWrite(APXLOG_MARK_INFO "Commons Daemon procrun (%s %d-bit) started",
+ PRG_VERSION, PRG_BITS);
AplZeroMemory(&gStdwrap, sizeof(APX_STDWRAP));
@@ -1421,7 +1516,7 @@
gStdwrap.szStdOutFilename = SO_STDOUTPUT;
gStdwrap.szStdErrFilename = SO_STDERROR;
}
- redirectStdStreams(&gStdwrap);
+ redirectStdStreams(&gStdwrap, lpCmdline);
if (lpCmdline->dwCmdIndex == 2) {
SYSTEMTIME t;
GetLocalTime(&t);
@@ -1474,9 +1569,18 @@
}
cleanup:
- if (rv)
+ if (rv) {
+ int ipx = 0;
+ if (rv > 0 && rv < 7)
+ ipx = rv;
apxLogWrite(APXLOG_MARK_ERROR "Commons Daemon procrun failed "
- "with exit value: %d", rv);
+ "with exit value: %d (Failed to %s)",
+ rv, gSzProc[ipx]);
+ if (ipx > 2 && !_service_mode) {
+ /* Print something to the user console */
+ apxDisplayError(FALSE, NULL, 0, "Failed to %s", gSzProc[ipx]);
+ }
+ }
else
apxLogWrite(APXLOG_MARK_INFO "Commons Daemon procrun finished");
if (lpCmdline)
13 years, 8 months
JBoss Native SVN: r2755 - tags.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2011-04-28 05:13:19 -0400 (Thu, 28 Apr 2011)
New Revision: 2755
Added:
tags/before_daemon-1.0.5/
Log:
before changing the service code to the latest daemon one.
13 years, 8 months
JBoss Native SVN: r2754 - in trunk: build/unix and 1 other directories.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2011-04-28 05:10:05 -0400 (Thu, 28 Apr 2011)
New Revision: 2754
Modified:
trunk/build/daemon/buildnat.bat
trunk/build/unix/build.sh
trunk/build/unix/package.list
trunk/srclib/tomcat-native/tomcat-native-1.1/NMAKEmakefile
Log:
Arrange static tcnative... and remove used dependencies.
Modified: trunk/build/daemon/buildnat.bat
===================================================================
--- trunk/build/daemon/buildnat.bat 2011-04-27 08:37:22 UTC (rev 2753)
+++ trunk/build/daemon/buildnat.bat 2011-04-28 09:10:05 UTC (rev 2754)
@@ -52,9 +52,9 @@
#call build.bat sdk i64 jboss-native -ssl -cache
# static dll tcnative-1.dll
-call build.bat sdk x86 jboss-native -ssl -cache -static
-call build.bat sdk x64 jboss-native -ssl -cache -static
-call build.bat sdk i64 jboss-native -ssl -cache -static
+call build.bat sdk static x86 jboss-native -ssl -cache -static
+call build.bat sdk static x64 jboss-native -ssl -cache -static
+call build.bat sdk static i64 jboss-native -ssl -cache -static
REM Uncomment for building sight
REM call build.bat sdk x86 jboss-sight -cache
REM call build.bat sdk x64 jboss-sight -cache
Modified: trunk/build/unix/build.sh
===================================================================
--- trunk/build/unix/build.sh 2011-04-27 08:37:22 UTC (rev 2753)
+++ trunk/build/unix/build.sh 2011-04-28 09:10:05 UTC (rev 2754)
@@ -807,7 +807,7 @@
echo "Building APR ${apr_version} in ${apr_srcdir}"
cygwinpath true PREFIX=${apr_common_dir} SRCDIR=`pwd`
if $apr_static ; then
- nmake -f NMAKEmakefile $wrapped_args APR_DECLARE_STATIC=true install
+ nmake -f NMAKEmakefile $wrapped_args APR_DECLARE_STATIC=1 install
else
nmake -f NMAKEmakefile $wrapped_args install
fi
@@ -862,7 +862,7 @@
echo "Building APR utilities ${apu_version} ..."
cygwinpath true WITH_APR=${apu_common_dir} PREFIX=${apu_common_dir} SRCDIR=`pwd`
if $apu_static ; then
- nmake -f NMAKEmakefile $wrapped_args APR_DECLARE_STATIC=true install
+ nmake -f NMAKEmakefile $wrapped_args APR_DECLARE_STATIC=1 install
else
nmake -f NMAKEmakefile $wrapped_args install
fi
@@ -904,7 +904,7 @@
echo "Building APR iconv ${api_version} ..."
cygwinpath true WITH_APR=${api_common_dir} PREFIX=${api_common_dir} SRCDIR=`pwd`
if $api_static ; then
- nmake -f NMAKEmakefile $wrapped_args APR_DECLARE_STATIC=true install
+ nmake -f NMAKEmakefile $wrapped_args APR_DECLARE_STATIC=1 install
else
nmake -f NMAKEmakefile $wrapped_args install
fi
@@ -943,7 +943,7 @@
cygwinpath true PREFIX=${any_common_dir} SRCDIR=`pwd`
if $any_static ; then
# XXX: That won't work probably.
- nmake -f NMAKEmakefile $wrapped_args ANY_DECLARE_STATIC=true install
+ nmake -f NMAKEmakefile $wrapped_args ANY_DECLARE_STATIC=1 APR_DECLARE_STATIC=1 install
else
nmake -f NMAKEmakefile $wrapped_args install
fi
@@ -990,7 +990,7 @@
echo "Building Zlib ${zlib_version} ..."
cygwinpath true PREFIX=${zlib_common_dir} SRCDIR=`pwd`
if $zlib_static ; then
- nmake -f NMAKEmakefile $wrapped_args ZLIB_DECLARE_STATIC=true install
+ nmake -f NMAKEmakefile $wrapped_args ZLIB_DECLARE_STATIC=1 install
else
nmake -f NMAKEmakefile $wrapped_args install
fi
Modified: trunk/build/unix/package.list
===================================================================
--- trunk/build/unix/package.list 2011-04-27 08:37:22 UTC (rev 2753)
+++ trunk/build/unix/package.list 2011-04-28 09:10:05 UTC (rev 2754)
@@ -11,7 +11,7 @@
jboss-native|2.0.7|TOMCAT_NATIVE_1_1_17|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8i|zlib:v:1.2.3
jboss-native|2.0.8|TOMCAT_NATIVE_1_1_18|apr:v:1.3.8|apu:v:1.3.9|api:v:1.2.1|ssl:v:0.9.8i|zlib:v:1.2.3
jboss-native|2.0.9|TOMCAT_NATIVE_1_1_20|apr:v:1.3.8|apu:v:1.3.9|api:v:1.2.1|ssl:v:0.9.8k|zlib:v:1.2.3
-jboss-native|2.0.10-dev|branches/1.1.x|apr:v:1.3.12|apu:v:1.3.10|api:v:1.2.1|ssl:v:0.9.8r|zlib:v:1.2.3
+jboss-native|2.0.10-dev|branches/1.1.x|apr:v:1.3.12|ssl:v:0.9.8r
# SIGHT
jboss-sight|1.0.0|trunk|apr:v:1.2.9|apu:v:1.2.8|api:v:1.2.1
jboss-sight|1.0.1|trunk|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1
Modified: trunk/srclib/tomcat-native/tomcat-native-1.1/NMAKEmakefile
===================================================================
--- trunk/srclib/tomcat-native/tomcat-native-1.1/NMAKEmakefile 2011-04-27 08:37:22 UTC (rev 2753)
+++ trunk/srclib/tomcat-native/tomcat-native-1.1/NMAKEmakefile 2011-04-28 09:10:05 UTC (rev 2754)
@@ -28,23 +28,21 @@
!IF !DEFINED(APR_DECLARE_STATIC) || "$(APR_DECLARE_STATIC)" == ""
PROJECT = libtcnative-1
APR_LIB = libapr-1.lib
-APU_LIB = libaprutil-1.lib
!ELSE
-CFLAGS = -DAPR_DECLARE_STATIC -DAPU_DECLARE_STATIC $(CFLAGS)
+CFLAGS = -DAPR_DECLARE_STATIC $(CFLAGS)
PROJECT = tcnative-1
APR_LIB = apr-1.lib
-APU_LIB = aprutil-1.lib
!ENDIF
TARGET = DLL
!include <..\..\NMAKEcommon.inc>
!IF DEFINED(WITH_OPENSSL) && "$(WITH_OPENSSL)" != "no"
-CFLAGS = $(CFLAGS) -DZLIB_WINAPI -DNO_IDEA -DNO_RC5 -DNO_MDC2 -DOPENSSL_NO_IDEA \
+CFLAGS = $(CFLAGS) -DNO_IDEA -DNO_RC5 -DNO_MDC2 -DOPENSSL_NO_IDEA \
-DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 -DHAVE_OPENSSL -DHAVE_SSL_SET_STATE=1 \
-DTCN_DECLARE_EXPORT
!ELSE
-CFLAGS = $(CFLAGS) -DZLIB_WINAPI -DTCN_DECLARE_EXPORT
+CFLAGS = $(CFLAGS) -DTCN_DECLARE_EXPORT
!ENDIF
!IF !DEFINED(SRCDIR) || "$(SRCDIR)" == ""
@@ -66,7 +64,7 @@
LFLAGS = $(LFLAGS) /version:1.1
LFLAGS = $(LFLAGS) user32.lib psapi.lib gdi32.lib shlwapi.lib wldap32.lib ole32.lib
-LFLAGS = $(LFLAGS) $(APR_LIB) $(APU_LIB)
+LFLAGS = $(LFLAGS) $(APR_LIB)
!IF DEFINED(WITH_OPENSSL) && "$(WITH_OPENSSL)" != "no"
LFLAGS = $(LFLAGS) libeay32.lib ssleay32.lib
LDIRS = $(LDIRS) /libpath:"$(WITH_OPENSSL)\lib"
13 years, 8 months
JBoss Native SVN: r2753 - trunk/build/unix.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2011-04-27 04:37:22 -0400 (Wed, 27 Apr 2011)
New Revision: 2753
Modified:
trunk/build/unix/build.sh
Log:
typo.
Modified: trunk/build/unix/build.sh
===================================================================
--- trunk/build/unix/build.sh 2011-04-26 11:19:55 UTC (rev 2752)
+++ trunk/build/unix/build.sh 2011-04-27 08:37:22 UTC (rev 2753)
@@ -1048,11 +1048,12 @@
buildapr srclib/apr-${apr_version} true || return 1
else
buildapr srclib/apr-${apr_version} false || return 1
+ fi
if $build_api; then
if $has_static ; then
buildapi srclib/apr-iconv-${api_version} true || return 1
else
- buildapi srclib/apr-iconv-${api_version} false || return 1
+ buildapi srclib/apr-iconv-${api_version} false || return 1
fi
fi
if $has_apu; then
13 years, 8 months
JBoss Native SVN: r2752 - trunk/build/unix.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2011-04-26 07:19:55 -0400 (Tue, 26 Apr 2011)
New Revision: 2752
Modified:
trunk/build/unix/build.sh
Log:
Don't build both static and dynamic.
That brings problems on windoze.
Modified: trunk/build/unix/build.sh
===================================================================
--- trunk/build/unix/build.sh 2011-04-26 09:57:37 UTC (rev 2751)
+++ trunk/build/unix/build.sh 2011-04-26 11:19:55 UTC (rev 2752)
@@ -1044,14 +1044,15 @@
fi
if $has_apr; then
- buildapr srclib/apr-${apr_version} false || return 1
if $has_static ; then
buildapr srclib/apr-${apr_version} true || return 1
- fi
+ else
+ buildapr srclib/apr-${apr_version} false || return 1
if $build_api; then
- buildapi srclib/apr-iconv-${api_version} false || return 1
if $has_static ; then
buildapi srclib/apr-iconv-${api_version} true || return 1
+ else
+ buildapi srclib/apr-iconv-${api_version} false || return 1
fi
fi
if $has_apu; then
@@ -1061,9 +1062,10 @@
apu_util=false
;;
esac
- buildapu srclib/apr-util-${apu_version} false $apu_util || return 1
if $has_static ; then
buildapu srclib/apr-util-${apu_version} true $apu_util || return 1
+ else
+ buildapu srclib/apr-util-${apu_version} false $apu_util || return 1
fi
fi
fi
13 years, 8 months
JBoss Native SVN: r2751 - trunk/build/daemon.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2011-04-26 05:57:37 -0400 (Tue, 26 Apr 2011)
New Revision: 2751
Modified:
trunk/build/daemon/buildnat.bat
Log:
Only build the static libraries.
Modified: trunk/build/daemon/buildnat.bat
===================================================================
--- trunk/build/daemon/buildnat.bat 2011-04-21 15:46:09 UTC (rev 2750)
+++ trunk/build/daemon/buildnat.bat 2011-04-26 09:57:37 UTC (rev 2751)
@@ -47,9 +47,9 @@
pushd %BUILD_HOME%\windows
# dynamic dll (lib*.dll).
-call build.bat sdk x86 jboss-native -ssl -cache
-call build.bat sdk x64 jboss-native -ssl -cache
-call build.bat sdk i64 jboss-native -ssl -cache
+#call build.bat sdk x86 jboss-native -ssl -cache
+#call build.bat sdk x64 jboss-native -ssl -cache
+#call build.bat sdk i64 jboss-native -ssl -cache
# static dll tcnative-1.dll
call build.bat sdk x86 jboss-native -ssl -cache -static
13 years, 8 months
JBoss Native SVN: r2750 - trunk/build/unix.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2011-04-21 11:46:09 -0400 (Thu, 21 Apr 2011)
New Revision: 2750
Modified:
trunk/build/unix/package.list
Log:
1.1.2 released.
Modified: trunk/build/unix/package.list
===================================================================
--- trunk/build/unix/package.list 2011-04-20 16:15:24 UTC (rev 2749)
+++ trunk/build/unix/package.list 2011-04-21 15:46:09 UTC (rev 2750)
@@ -53,5 +53,6 @@
mod_cluster|1.0.9.GA|2.2.15|ssl:v:0.9.8k|zlib:v:1.2.3|jk:v:1.2.30|iconv:v:1.11|expat:v:1.95.8|cluster:t:1.0.9.GA
mod_cluster|1.1.2.dev|2.2.15|ssl:v:0.9.8k|zlib:v:1.2.3|jk:v:1.2.30|iconv:v:1.11|expat:v:1.95.8|cluster:t:trunk
mod_cluster|1.0.10.GA|2.2.15|ssl:v:0.9.8k|zlib:v:1.2.3|jk:v:1.2.30|iconv:v:1.11|expat:v:1.95.8|cluster:t:1.0.10.GA
+mod_cluster|1.1.2.Final|2.2.15|ssl:v:0.9.8k|zlib:v:1.2.3|jk:v:1.2.30|iconv:v:1.11|expat:v:1.95.8|cluster:t:1.1.2.Final
traffic_server|TS_Trunk|trunk
TC7|TC7_Trunk|trunk
13 years, 8 months