You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2001/07/19 23:52:48 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup StopTomcat.java

costin      01/07/19 14:52:48

  Modified:    src/share/org/apache/tomcat/startup StopTomcat.java
  Log:
  Allow users to specify the location of ajp12.id
  
  Revision  Changes    Path
  1.8       +17 -2     jakarta-tomcat/src/share/org/apache/tomcat/startup/StopTomcat.java
  
  Index: StopTomcat.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/StopTomcat.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- StopTomcat.java	2001/03/27 20:27:41	1.7
  +++ StopTomcat.java	2001/07/19 21:52:48	1.8
  @@ -83,6 +83,7 @@
       String secret;
       // explicit command line params ( for port, host or secret )
       boolean commandLineParams=false;
  +    String secretFile=null;
       
       public StopTomcat() 
       {
  @@ -90,6 +91,10 @@
   
       // -------------------- Parameters --------------------
   
  +    public void setSecretFile( String s ) {
  +	secretFile=s;
  +    }
  +    
       public void setH( String s ) {
   	tomcatHome=s;
   	System.getProperties().put("tomcat.home", s);
  @@ -140,8 +145,10 @@
   	// read TOMCAT_HOME/conf/ajp12.id unless command line params
   	// specify a port/host/secret
   	try {
  +	    if( secretFile==null )
  +		secretFile=tchome + "/conf/ajp12.id";
   	    BufferedReader rd=new BufferedReader
  -		( new FileReader( tchome + "/conf/ajp12.id"));
  +		( new FileReader(secretFile));
   	    String line=rd.readLine();
   	    
   	    if( port < 0 ) {
  @@ -158,7 +165,7 @@
   	    if( secret==null ) secret=line;
   	} catch( IOException ex ) {
   	    //ex.printStackTrace();
  -	    System.out.println("Can't read " + tchome + "/conf/ajp12.id");
  +	    System.out.println("Can't read " + secretFile);
   	    //	    System.out.println(ex.toString());
   	    if( ! commandLineParams )
   		return;
  @@ -279,6 +286,14 @@
   		commandLineParams=true;
   		if (i < args.length) 
   		    secret=args[i];
  +		else
  +		    return false;
  +	    }
  +	    if (arg.equalsIgnoreCase("-ajpid") ) {
  +		i++;
  +		commandLineParams=true;
  +		if (i < args.length) 
  +		    secretFile=args[i];
   		else
   		    return false;
   	    }