From 78753263e52ada59f8836e83f00c0613488df87e Mon Sep 17 00:00:00 2001 From: Joshua McKenzie Date: Wed, 14 Oct 2015 14:43:32 -0400 Subject: [PATCH] Add -a option to skip TIME_WAIT port check on Windows startup Patch by jmckenzie; reviewed by pthompson for CASSANDRA-10524 --- bin/cassandra.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/cassandra.ps1 b/bin/cassandra.ps1 index 5cc99aa13b..8cdd433d2e 100644 --- a/bin/cassandra.ps1 +++ b/bin/cassandra.ps1 @@ -27,6 +27,7 @@ usage: cassandra.ps1 [-f] [-h] [-p pidfile] [-H dumpfile] [-D arg] [-E errorfile -E change JVM ErrorFile -v Print cassandra version and exit -s Show detailed jvm environment information during launch + -a Aggressive startup. Ignore ports that are TIME_WAIT for VerifyPorts check. -help print this message NOTE: installing cassandra as a service requires Commons Daemon Service Runner @@ -307,6 +308,10 @@ Function VerifyPortsAreAvailable { if ($line -match "TCP" -and $line -match $portRegex) { + if ($a -and $line -match "TIME_WAIT") + { + continue + } Write-Error "Found a port already in use. Aborting startup" Write-Error $line Exit @@ -352,12 +357,15 @@ for ($i = 0; $i -lt $args.count; $i++) "-install" { $install = $True } "-uninstall" { $uninstall = $True } "-help" { PrintUsage } + "-?" { PrintUsage } + "--help" { PrintUsage } "-v" { $v = $True } "-f" { $f = $True } "-s" { $s = $True } "-p" { $p = $args[++$i]; CheckEmptyParam($p) } "-H" { $H = $args[++$i]; CheckEmptyParam($H) } "-E" { $E = $args[++$i]; CheckEmptyParam($E) } + "-a" { $a = $True } default { "Invalid argument: " + $args[$i];