manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1629122 - in /manifoldcf/trunk: ./ framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ framework/scripts-combined/ framework/scripts-jetty/ framework/scripts-start/
Date Fri, 03 Oct 2014 06:55:33 GMT
Author: kwright
Date: Fri Oct  3 06:55:33 2014
New Revision: 1629122

URL: http://svn.apache.org/r1629122
Log:
Partial fix for CONNECTORS-1053.  Shutdown still generates exceptions though.

Added:
    manifoldcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFJettyShutdown.java
  (with props)
    manifoldcf/trunk/framework/scripts-combined/stop-combined.bat   (with props)
    manifoldcf/trunk/framework/scripts-combined/stop-combined.sh   (with props)
    manifoldcf/trunk/framework/scripts-start/stop.bat   (with props)
    manifoldcf/trunk/framework/scripts-start/stop.sh   (with props)
Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFCombinedJettyRunner.java
    manifoldcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFJettyRunner.java
    manifoldcf/trunk/framework/scripts-combined/combined-options.env.unix
    manifoldcf/trunk/framework/scripts-combined/combined-options.env.win
    manifoldcf/trunk/framework/scripts-jetty/jetty-options.env.unix
    manifoldcf/trunk/framework/scripts-jetty/jetty-options.env.win
    manifoldcf/trunk/framework/scripts-start/start-options.env.unix
    manifoldcf/trunk/framework/scripts-start/start-options.env.win

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1629122&r1=1629121&r2=1629122&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Fri Oct  3 06:55:33 2014
@@ -3,6 +3,9 @@ $Id$
 
 ======================= 2.0-dev =====================
 
+CONNECTORS-1053: Provide stop scripts for single-process examples.
+(Shinichiro Abe, Karl Wright)
+
 CONNECTORS-1054: Document plugins for SharePoint more completely.
 (Karl Wright)
 

Modified: manifoldcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFCombinedJettyRunner.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFCombinedJettyRunner.java?rev=1629122&r1=1629121&r2=1629122&view=diff
==============================================================================
--- manifoldcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFCombinedJettyRunner.java
(original)
+++ manifoldcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFCombinedJettyRunner.java
Fri Oct  3 06:55:33 2014
@@ -38,9 +38,11 @@ import org.eclipse.jetty.xml.XmlConfigur
 import org.eclipse.jetty.server.ServerConnector;
 import org.eclipse.jetty.webapp.WebAppContext;
 import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.handler.HandlerList;
+import org.eclipse.jetty.server.handler.ShutdownHandler;
+import org.eclipse.jetty.server.Handler;
 
-/**
- * Run ManifoldCF with jetty.
+ /* Run ManifoldCF with jetty.
  * 
  */
 public class ManifoldCFCombinedJettyRunner
@@ -75,10 +77,23 @@ public class ManifoldCFCombinedJettyRunn
     
     // Initialize the servlets
     ContextHandlerCollection contexts = new ContextHandlerCollection();
-    server.setHandler(contexts);
     WebAppContext mcfCombined = new WebAppContext(combinedWarPath,"/mcf");
     mcfCombined.setParentLoaderPriority(false);
     contexts.addHandler(mcfCombined);
+    
+    HandlerList handlers = new HandlerList();
+    handlers.addHandler(contexts);
+    
+    // Pick up shutdown token
+    String shutdownToken = System.getProperty("org.apache.manifoldcf.jettyshutdowntoken");
+    if (shutdownToken != null)
+    {
+      ShutdownHandler shutdown = new ShutdownHandler(shutdownToken);
+      shutdown.setExitJvm(true);
+
+      handlers.addHandler(shutdown);
+    }
+    server.setHandler(handlers);
   }
   
   public void start()

Modified: manifoldcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFJettyRunner.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFJettyRunner.java?rev=1629122&r1=1629121&r2=1629122&view=diff
==============================================================================
--- manifoldcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFJettyRunner.java
(original)
+++ manifoldcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFJettyRunner.java
Fri Oct  3 06:55:33 2014
@@ -39,6 +39,9 @@ import org.eclipse.jetty.xml.XmlConfigur
 import org.eclipse.jetty.server.ServerConnector;
 import org.eclipse.jetty.webapp.WebAppContext;
 import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.handler.HandlerList;
+import org.eclipse.jetty.server.handler.ShutdownHandler;
+import org.eclipse.jetty.server.Handler;
 
 /**
  * Run ManifoldCF with jetty.
@@ -78,7 +81,6 @@ public class ManifoldCFJettyRunner
     
     // Initialize the servlets
     ContextHandlerCollection contexts = new ContextHandlerCollection();
-    server.setHandler(contexts);
     WebAppContext lcfCrawlerUI = new WebAppContext(crawlerWarPath,"/mcf-crawler-ui");
     // This can cause jetty to ignore all of the framework and jdbc jars in the war, which
is what we
     // want in the single-process case.
@@ -94,6 +96,21 @@ public class ManifoldCFJettyRunner
     // want in the single-process case.
     lcfApi.setParentLoaderPriority(useParentLoader);
     contexts.addHandler(lcfApi);
+    
+    HandlerList handlers = new HandlerList();
+    handlers.addHandler(contexts);
+    
+    // Pick up shutdown token
+    String shutdownToken = System.getProperty("org.apache.manifoldcf.jettyshutdowntoken");
+    if (shutdownToken != null)
+    {
+      ShutdownHandler shutdown = new ShutdownHandler(shutdownToken);
+      shutdown.setExitJvm(true);
+
+      handlers.addHandler(shutdown);
+    }
+    server.setHandler(handlers);
+
   }
 
   public void start()

Added: manifoldcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFJettyShutdown.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFJettyShutdown.java?rev=1629122&view=auto
==============================================================================
--- manifoldcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFJettyShutdown.java
(added)
+++ manifoldcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFJettyShutdown.java
Fri Oct  3 06:55:33 2014
@@ -0,0 +1,148 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.manifoldcf.jettyrunner;
+
+import org.apache.http.client.HttpClient;
+import org.apache.http.conn.HttpClientConnectionManager;
+import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.protocol.HttpRequestExecutor;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.CredentialsProvider;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.config.SocketConfig;
+import org.apache.http.HttpEntity;
+import org.apache.http.impl.client.DefaultRedirectStrategy;
+import org.apache.http.entity.ContentType;
+import org.apache.http.ParseException;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.entity.ContentType;
+import org.apache.http.HttpStatus;
+import org.apache.http.HttpException;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.conn.ConnectTimeoutException;
+import org.apache.http.HttpResponse;
+import org.apache.http.util.EntityUtils;
+
+import java.nio.charset.StandardCharsets;
+import java.util.*;
+import java.io.*;
+import java.net.URLEncoder;
+import java.nio.charset.Charset;
+
+ /* Shutdown jetty by posting the shutdown token
+ * 
+ */
+public class ManifoldCFJettyShutdown
+{
+
+  public static final String _rcsid = "@(#)$Id$";
+
+  protected final String jettyBaseURL;
+  
+  public ManifoldCFJettyShutdown(String jettyBaseURL)
+  {
+    this.jettyBaseURL = jettyBaseURL;
+  }
+
+  public void shutdownJetty()
+    throws Exception
+  {
+    // Pick up shutdown token
+    String shutdownToken = System.getProperty("org.apache.manifoldcf.jettyshutdowntoken");
+    if (shutdownToken != null)
+    {
+      int socketTimeout = 900000;
+      int connectionTimeout = 300000;
+
+      HttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager();
+        
+      RequestConfig.Builder requestBuilder = RequestConfig.custom()
+        .setCircularRedirectsAllowed(true)
+        .setSocketTimeout(socketTimeout)
+        .setStaleConnectionCheckEnabled(false)
+        .setExpectContinueEnabled(true)
+        .setConnectTimeout(connectionTimeout)
+        .setConnectionRequestTimeout(socketTimeout);
+
+      HttpClient httpClient = HttpClients.custom()
+        .setConnectionManager(connectionManager)
+        .setMaxConnTotal(1)
+        .disableAutomaticRetries()
+        .setDefaultRequestConfig(requestBuilder.build())
+        .setDefaultSocketConfig(SocketConfig.custom()
+          .setTcpNoDelay(true)
+          .setSoTimeout(socketTimeout)
+          .build())
+        .setRequestExecutor(new HttpRequestExecutor(socketTimeout))
+        .setRedirectStrategy(new DefaultRedirectStrategy())
+        .build();
+
+      HttpPost method = new HttpPost(jettyBaseURL+"/shutdown?token="+URLEncoder.encode(shutdownToken,"UTF-8"));
+      method.setEntity(new StringEntity("",ContentType.create("text/plain", StandardCharsets.UTF_8)));
+      try
+      {
+        HttpResponse httpResponse = httpClient.execute(method);
+        int resultCode = httpResponse.getStatusLine().getStatusCode();
+        if (resultCode != 200)
+          throw new Exception("Received result code "+resultCode+" from POST");
+      }
+      catch (org.apache.http.NoHttpResponseException e)
+      {
+        // This is ok and expected
+      }
+    }
+    else
+    {
+      throw new Exception("No jetty shutdown token specified");
+    }
+  }
+  
+  /**
+   * A main class that sends a shutdown token to Jetty
+   */
+  public static void main( String[] args )
+  {
+    if (args.length != 0 && args.length != 1)
+    {
+      System.err.println("Usage: ManifoldCFJettyShutdown [<jetty_base_url>]");
+      System.exit(1);
+    }
+    
+    String jettyURL;
+    if (args.length > 0)
+      jettyURL = args[0];
+    else
+      jettyURL = "http://localhost:8345";
+    
+    try
+    {
+      ManifoldCFJettyShutdown js = new ManifoldCFJettyShutdown(jettyURL);
+      js.shutdownJetty();
+    }
+    catch (Exception e)
+    {
+      e.printStackTrace(System.err);
+      System.exit(1);
+    }
+  }
+  
+}
+
+

Propchange: manifoldcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFJettyShutdown.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: manifoldcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFJettyShutdown.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: manifoldcf/trunk/framework/scripts-combined/combined-options.env.unix
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/scripts-combined/combined-options.env.unix?rev=1629122&r1=1629121&r2=1629122&view=diff
==============================================================================
--- manifoldcf/trunk/framework/scripts-combined/combined-options.env.unix (original)
+++ manifoldcf/trunk/framework/scripts-combined/combined-options.env.unix Fri Oct  3 06:55:33
2014
@@ -1,5 +1,6 @@
 -Xms256m
 -Xmx256m
 -Dorg.apache.manifoldcf.configfile=./properties.xml
+-Dorg.apache.manifoldcf.jettyshutdowntoken=secret_token
 -cp
 .:

Modified: manifoldcf/trunk/framework/scripts-combined/combined-options.env.win
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/scripts-combined/combined-options.env.win?rev=1629122&r1=1629121&r2=1629122&view=diff
==============================================================================
--- manifoldcf/trunk/framework/scripts-combined/combined-options.env.win (original)
+++ manifoldcf/trunk/framework/scripts-combined/combined-options.env.win Fri Oct  3 06:55:33
2014
@@ -1,5 +1,6 @@
 -Xms256m
 -Xmx256m
 -Dorg.apache.manifoldcf.configfile=.\properties.xml
+-Dorg.apache.manifoldcf.jettyshutdowntoken=secret_token
 -cp
 .;

Added: manifoldcf/trunk/framework/scripts-combined/stop-combined.bat
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/scripts-combined/stop-combined.bat?rev=1629122&view=auto
==============================================================================
--- manifoldcf/trunk/framework/scripts-combined/stop-combined.bat (added)
+++ manifoldcf/trunk/framework/scripts-combined/stop-combined.bat Fri Oct  3 06:55:33 2014
@@ -0,0 +1,31 @@
+@echo off
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem     http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+rem check that JAVA_HOME is set, and that the current directory is correct
+if not exist "%JAVA_HOME%\bin\java.exe" goto nojavahome
+if not exist ".\properties.xml" goto nolcfhome
+set JAVAOPTIONS=
+for /f "delims=" %%a in ('type combined-options.env.win') do call setjavaoption.bat "%%a"
+rem invoke java with the jetty class
+"%JAVA_HOME%\bin\java" %JAVAOPTIONS% org.apache.manifoldcf.jettyrunner.ManifoldCFJettyShutdown
"http://localhost:8345"
+goto done
+:nojavahome
+echo Environment variable JAVA_HOME is not set properly.
+goto done
+:nolcfhome
+echo Current working directory does not contain a properties.xml file.
+goto done
+:done

Propchange: manifoldcf/trunk/framework/scripts-combined/stop-combined.bat
------------------------------------------------------------------------------
    svn:eol-style = CRLF

Added: manifoldcf/trunk/framework/scripts-combined/stop-combined.sh
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/scripts-combined/stop-combined.sh?rev=1629122&view=auto
==============================================================================
--- manifoldcf/trunk/framework/scripts-combined/stop-combined.sh (added)
+++ manifoldcf/trunk/framework/scripts-combined/stop-combined.sh Fri Oct  3 06:55:33 2014
@@ -0,0 +1,41 @@
+#!/bin/bash -e
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+if [[ $OSTYPE == "cygwin" ]] ; then
+    OPTIONSFILE="combined-options.env.win"
+else
+    OPTIONSFILE="combined-options.env.unix"
+fi
+
+#Make sure environment variables are properly set
+if [ -e "$JAVA_HOME"/bin/java ] ; then
+    if [ -f ./properties.xml ] ; then
+        # Build the global options
+        OPTIONS=$(cat "$OPTIONSFILE")
+        
+        "$JAVA_HOME/bin/java" $OPTIONS org.apache.manifoldcf.jettyrunner.ManifoldCFJettyShutdown
"http://localhost:8345"
+        exit $?
+        
+    else
+        echo "Working directory contains no properties.xml file." 1>&2
+        exit 1
+    fi
+
+else
+    echo "Environment variable JAVA_HOME is not properly set." 1>&2
+    exit 1
+fi

Propchange: manifoldcf/trunk/framework/scripts-combined/stop-combined.sh
------------------------------------------------------------------------------
    svn:eol-style = LF

Modified: manifoldcf/trunk/framework/scripts-jetty/jetty-options.env.unix
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/scripts-jetty/jetty-options.env.unix?rev=1629122&r1=1629121&r2=1629122&view=diff
==============================================================================
--- manifoldcf/trunk/framework/scripts-jetty/jetty-options.env.unix (original)
+++ manifoldcf/trunk/framework/scripts-jetty/jetty-options.env.unix Fri Oct  3 06:55:33 2014
@@ -1,5 +1,6 @@
 -Xms256m
 -Xmx256m
 -Dorg.apache.manifoldcf.configfile=./properties.xml
+-Dorg.apache.manifoldcf.jettyshutdowntoken=secret_token
 -cp
 .:

Modified: manifoldcf/trunk/framework/scripts-jetty/jetty-options.env.win
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/scripts-jetty/jetty-options.env.win?rev=1629122&r1=1629121&r2=1629122&view=diff
==============================================================================
--- manifoldcf/trunk/framework/scripts-jetty/jetty-options.env.win (original)
+++ manifoldcf/trunk/framework/scripts-jetty/jetty-options.env.win Fri Oct  3 06:55:33 2014
@@ -1,5 +1,6 @@
 -Xms256m
 -Xmx256m
 -Dorg.apache.manifoldcf.configfile=.\properties.xml
+-Dorg.apache.manifoldcf.jettyshutdowntoken=secret_token
 -cp
 .;

Modified: manifoldcf/trunk/framework/scripts-start/start-options.env.unix
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/scripts-start/start-options.env.unix?rev=1629122&r1=1629121&r2=1629122&view=diff
==============================================================================
--- manifoldcf/trunk/framework/scripts-start/start-options.env.unix (original)
+++ manifoldcf/trunk/framework/scripts-start/start-options.env.unix Fri Oct  3 06:55:33 2014
@@ -1,5 +1,6 @@
 -Xms256m
 -Xmx256m
 -Dorg.apache.manifoldcf.configfile=./properties.xml
+-Dorg.apache.manifoldcf.jettyshutdowntoken=secret_token
 -cp
 .:

Modified: manifoldcf/trunk/framework/scripts-start/start-options.env.win
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/scripts-start/start-options.env.win?rev=1629122&r1=1629121&r2=1629122&view=diff
==============================================================================
--- manifoldcf/trunk/framework/scripts-start/start-options.env.win (original)
+++ manifoldcf/trunk/framework/scripts-start/start-options.env.win Fri Oct  3 06:55:33 2014
@@ -1,5 +1,6 @@
 -Xms256m
 -Xmx256m
 -Dorg.apache.manifoldcf.configfile=.\properties.xml
+-Dorg.apache.manifoldcf.jettyshutdowntoken=secret_token
 -cp
 .;

Added: manifoldcf/trunk/framework/scripts-start/stop.bat
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/scripts-start/stop.bat?rev=1629122&view=auto
==============================================================================
--- manifoldcf/trunk/framework/scripts-start/stop.bat (added)
+++ manifoldcf/trunk/framework/scripts-start/stop.bat Fri Oct  3 06:55:33 2014
@@ -0,0 +1,31 @@
+@echo off
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem     http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+rem check that JAVA_HOME is set, and that the current directory is correct
+if not exist "%JAVA_HOME%\bin\java.exe" goto nojavahome
+if not exist ".\properties.xml" goto nolcfhome
+set JAVAOPTIONS=
+for /f "delims=" %%a in ('type start-options.env.win') do call setjavaoption.bat "%%a"
+rem invoke java with the jetty class
+"%JAVA_HOME%\bin\java" %JAVAOPTIONS% org.apache.manifoldcf.jettyrunner.ManifoldCFJettyShutdown
"http://localhost:8345"
+goto done
+:nojavahome
+echo Environment variable JAVA_HOME is not set properly.
+goto done
+:nolcfhome
+echo Current working directory does not contain a properties.xml file.
+goto done
+:done

Propchange: manifoldcf/trunk/framework/scripts-start/stop.bat
------------------------------------------------------------------------------
    svn:eol-style = CRLF

Added: manifoldcf/trunk/framework/scripts-start/stop.sh
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/scripts-start/stop.sh?rev=1629122&view=auto
==============================================================================
--- manifoldcf/trunk/framework/scripts-start/stop.sh (added)
+++ manifoldcf/trunk/framework/scripts-start/stop.sh Fri Oct  3 06:55:33 2014
@@ -0,0 +1,41 @@
+#!/bin/bash -e
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+if [[ $OSTYPE == "cygwin" ]] ; then
+    OPTIONSFILE="start-options.env.win"
+else
+    OPTIONSFILE="start-options.env.unix"
+fi
+
+#Make sure environment variables are properly set
+if [ -e "$JAVA_HOME"/bin/java ] ; then
+    if [ -f ./properties.xml ] ; then
+        # Build the global options
+        OPTIONS=$(cat "$OPTIONSFILE")
+        
+        "$JAVA_HOME/bin/java" $OPTIONS org.apache.manifoldcf.jettyrunner.ManifoldCFJettyShutdown
"http://localhost:8345"
+        exit $?
+        
+    else
+        echo "Working directory contains no properties.xml file." 1>&2
+        exit 1
+    fi
+
+else
+    echo "Environment variable JAVA_HOME is not properly set." 1>&2
+    exit 1
+fi

Propchange: manifoldcf/trunk/framework/scripts-start/stop.sh
------------------------------------------------------------------------------
    svn:eol-style = LF



Mime
View raw message