Author: billbarker
Date: Sun Apr 17 19:32:38 2005
New Revision: 161711

URL: http://svn.apache.org/viewcvs?view=rev&rev=161711
Log:
Allow the process name to be configurable on Linux.

Fix for Bug #33981

Modified:
    jakarta/commons/proper/daemon/trunk/src/native/unix/native/Makefile.in
    jakarta/commons/proper/daemon/trunk/src/native/unix/native/arguments.c
    jakarta/commons/proper/daemon/trunk/src/native/unix/native/arguments.h
    jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c

Modified: jakarta/commons/proper/daemon/trunk/src/native/unix/native/Makefile.in
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/daemon/trunk/src/native/unix/native/Makefile.in?view=diff&r1=161710&r2=161711
==============================================================================
--- jakarta/commons/proper/daemon/trunk/src/native/unix/native/Makefile.in 
(original)
+++ jakarta/commons/proper/daemon/trunk/src/native/unix/native/Makefile.in Sun 
Apr 17 19:32:38 2005
@@ -14,7 +14,7 @@
 #   limitations under the License.
 #
 # @author  Pier Fumagalli <mailto:[EMAIL PROTECTED]>
-# @version $Id: Makefile.in,v 1.2 2004/02/09 15:55:21 jfclere Exp $
+# @version $Id$
 
 include ../Makedefs
 

Modified: jakarta/commons/proper/daemon/trunk/src/native/unix/native/arguments.c
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/daemon/trunk/src/native/unix/native/arguments.c?view=diff&r1=161710&r2=161711
==============================================================================
--- jakarta/commons/proper/daemon/trunk/src/native/unix/native/arguments.c 
(original)
+++ jakarta/commons/proper/daemon/trunk/src/native/unix/native/arguments.c Sun 
Apr 17 19:32:38 2005
@@ -54,7 +54,7 @@
     args->outfile="/dev/null";   /* Swallow by default */
     args->errfile="/dev/null";   /* Swallow by default */
     args->args=(char **)malloc(argc*sizeof(char *));
-
+    args->procname = "jsvc.exec";
     /* Set up the command name */
     cmnd=strrchr(argv[0],'/');
     if (cmnd==NULL) cmnd=argv[0];
@@ -176,6 +176,12 @@
             log_error("Invalid option %s",argv[x]);
             return(NULL);
 
+        } else if (strcmp(argv[x],"-procname") == 0) {
+            args->procname = optional(argc, argv, x++);
+            if(args->procname == NULL) {
+              log_error("Invalid process name specified");
+              return (NULL);
+            }
         } else {
             args->clas=strdup(argv[x]);
             break;

Modified: jakarta/commons/proper/daemon/trunk/src/native/unix/native/arguments.h
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/daemon/trunk/src/native/unix/native/arguments.h?view=diff&r1=161710&r2=161711
==============================================================================
--- jakarta/commons/proper/daemon/trunk/src/native/unix/native/arguments.h 
(original)
+++ jakarta/commons/proper/daemon/trunk/src/native/unix/native/arguments.h Sun 
Apr 17 19:32:38 2005
@@ -61,6 +61,8 @@
     char *outfile;
     /** Destination for stderr */
     char *errfile;
+    /** Program name for Linux **/
+    char *procname;
 } arg_data;
 
 /**

Modified: jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c?view=diff&r1=161710&r2=161711
==============================================================================
--- jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c 
(original)
+++ jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c Sun 
Apr 17 19:32:38 2005
@@ -403,7 +403,7 @@
     /* On some UNIX operating systems, we need to REPLACE this current
        process image with another one (thru execve) to allow the correct
        loading of VMs (notably this is for Linux). Set, replace, and go. */
-    if (strcmp(argv[0],"jsvc.exec")!=0) {
+    if (strcmp(argv[0],args->procname)!=0) {
         char *oldpath=getenv("LD_LIBRARY_PATH");
         char *libf=java_library(args,data);
         char *old=argv[0];
@@ -428,7 +428,7 @@
 
         log_debug("Invoking w/ LD_LIBRARY_PATH=%s",getenv("LD_LIBRARY_PATH"));
 
-        argv[0]="jsvc.exec";
+        argv[0]=args->procname;
         execve(old,argv,environ);
         log_error("Cannot execute JSVC executor process");
         return(1);



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to