Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for disabling the killSwitch Port #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/docs/guide/running.gdoc
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ There are several arguments you can pass to customize how the application runs,
# @nio@ or @tomcat.nio@, whether to use NIO; defaults to true
# @serverName@, a specific value to use as HTTP Server Header, by default tomcat will use Apache-Coyote/1.1 if none set at application level (Tomcat only)
# @enableProxySupport@, enables support for X-Forwarded headers by adding a pre-configured RemoteIpValve, defaults to false (Tomcat only)
# @enableKillSwitch@, enables a listener on port+1 which will terminate tomcat upon receiving a request, defaults to true (Tomcat only)

In addition, if you specify a value that is the name of a system property (e.g. 'home.dir'), the system property value will be used.

Expand Down
2 changes: 1 addition & 1 deletion src/java/grails/plugin/standalone/AbstractLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public abstract class AbstractLauncher {
"keystorePassword", "javax.net.ssl.keyStorePassword", "truststorePath", "javax.net.ssl.trustStore",
"trustStorePassword", "javax.net.ssl.trustStorePassword", "enableClientAuth", "workDir",
"enableCompression", "compressableMimeTypes", "sessionTimeout", "nio", "tomcat.nio",
"serverName", "enableProxySupport");
"serverName", "enableProxySupport", "enableKillSwitch");

protected Map<String, String> argsMap;

Expand Down
6 changes: 4 additions & 2 deletions src/runtime/grails/plugin/standalone/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public class Launcher extends AbstractLauncher {
* <li>nio or tomcat.nio, defaults to true</li>
* <li>serverName, a specific value to use as HTTP Server Header, no default</li>
* <li>enableProxySupport, enables support for X-Forwarded headers, defaults to false</li>
* <li>enableKillSwitch, enables a listener on port+1 which will terminate tomcat upon receiving a request, defaults to true</li>
* </ul>
* In addition, if you specify a value that is the name of a system
* property (e.g. 'home.dir'), the system property value will be used.
Expand Down Expand Up @@ -137,8 +138,9 @@ protected void start(File exploded) throws IOException, ServletException {
enableClientAuth, truststorePath, trustStorePassword,
sessionTimeout, enableCompression, compressableMimeTypes, useNio,
serverName, enableProxySupport);

startKillSwitchThread(port);

boolean enableKillSwitch = getBooleanArg("enableKillSwitch", true);
if (enableKillSwitch) {startKillSwitchThread(port);}
addShutdownHook();
addFailureLifecycleListener(contextPath);

Expand Down