Merge pull request #12961 from brwe/jps-check
check with jps that the pid file contains a pid that actually is an e…
This commit is contained in:
commit
12aeafcbed
|
@ -219,6 +219,30 @@
|
|||
|
||||
<extract-pid file="@{es.pidfile}" property="integ.pid"/>
|
||||
<echo>Shutting down external node PID ${integ.pid}</echo>
|
||||
<!-- verify with jps that this actually is the correct pid.
|
||||
See if we can find the line "pid org.elasticsearch.bootstrap.Elasticsearch" in the output of jps -l.-->
|
||||
<local name="jps.pidline"/>
|
||||
<local name="jps.executable"/>
|
||||
<local name="environment"/>
|
||||
<property environment="environment"/>
|
||||
<property name="jps.executable" location="${environment.JAVA_HOME}/bin/jps"/>
|
||||
<exec executable="${jps.executable}" failonerror="true">
|
||||
<arg value="-l"/>
|
||||
<redirector outputproperty="jps.pidline">
|
||||
<outputfilterchain>
|
||||
<linecontains>
|
||||
<contains value="${integ.pid} org.elasticsearch.bootstrap.Elasticsearch"/>
|
||||
</linecontains>
|
||||
</outputfilterchain>
|
||||
</redirector>
|
||||
</exec>
|
||||
<fail
|
||||
message="pid file at @{es.pidfile} is ${integ.pid} but jps -l did not report any process with org.elasticsearch.bootstrap.Elasticsearch and this pid.
|
||||
Did you run mvn clean? Maybe an old pid file is still lying around.">
|
||||
<condition>
|
||||
<equals arg1="${jps.pidline}" arg2=""/>
|
||||
</condition>
|
||||
</fail>
|
||||
|
||||
<exec executable="taskkill" failonerror="true" osfamily="winnt">
|
||||
<arg value="/F"/>
|
||||
|
@ -271,8 +295,6 @@
|
|||
<startup-elasticsearch/>
|
||||
</target>
|
||||
|
||||
<!-- TODO, for some more safety, add back some of the old jps logic
|
||||
and verify the pid is really an ES process! (fail otherwise) -->
|
||||
<target name="stop-external-cluster" if="integ.pidfile.exists">
|
||||
<stop-node/>
|
||||
</target>
|
||||
|
|
Loading…
Reference in New Issue