Adam L Levine created DIRSERVER-2361:
----------------------------------------
Summary: subsequent starts under gradle ignore existing process
Key: DIRSERVER-2361
URL: https://issues.apache.org/jira/browse/DIRSERVER-2361
Project: Directory ApacheDS
Issue Type: Bug
Affects Versions: 2.0.0.AM26
Environment: Centos 8 Stream
+
Gradle 7.3.3
------------------------------------------------------------
Build time: 2021-12-22 12:37:54 UTC
Revision: 6f556c80f945dc54b50e0be633da6c62dbe8dc71
Kotlin: 1.5.31
Groovy: 3.0.9
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 1.8.0_312 (Red Hat, Inc. 25.312-b07)
OS: Linux 4.18.0-348.2.1.el8_5.x86_64 amd64
Reporter: Adam L Levine
I can't replicate this via just command line, but can repeatedly using gradle.
I can't find what's different about the gradle launch vs running it by hand.
FWIW, there are 2 parallel folder structures: one for the gradle scripts, one
for DS.
I've pasted the console output and the relevant gradle script.
{*}Overview{*}:
# I start DS via a gradle task
# I can verify the PID matches the ID stored in apacheds.pid
# I run the start task again
# DS starts a 2nd process, but fails and exits because the listening port is
already bound by the first process
# The ID stored in apacheds.pid now contains the PID of the 2nd process.
# stop/status will now fail because the PID doesn't match
*==== Console output from above steps ====*
{{$ ps -ef | grep pach}}
{{adam 42758 27739 0 01:30 pts/2 00:00:00 grep --color=auto pach}}
{{ }}
{{$ ./gradlew startLdap}}
{{> Task :startLdap}}
{{{}Done with startLdap{}}}{{{}BUILD SUCCESSFUL in 1s{}}}
{{1 actionable task: 1 executed}}
{{ }}
{{$ ps -ef | grep pach}}
{{adam 42842 1 72 01:30 ? 00:00:03 /usr/bin/java
-Dapacheds.controls= -Dapacheds.extendedOperations=
-Dapacheds.intermediateResponses=
-Dlog4j.configuration=file:/home/adam/code/j20/ldap/app/apacheds-2.0.0.AM26/instances/default/conf/log4j.properties
-Dapacheds.shutdown.port=0
-Dapacheds.log.dir=/home/adam/code/j20/ldap/app/apacheds-2.0.0.AM26/instances/default/log
-classpath
/home/adam/code/j20/ldap/app/apacheds-2.0.0.AM26/lib/apacheds-service-2.0.0.AM26.jar
org.apache.directory.server.UberjarMain
/home/adam/code/j20/ldap/app/apacheds-2.0.0.AM26/instances/default}}
{{adam 42866 27739 0 01:30 pts/2 00:00:00 grep --color=auto pach}}
{{ }}
{{$ cat ~/code/j20/ldap/app/latest/instances/default/run/apacheds.pid}}
{{42842}}
{{ }}
{{$ ./gradlew startLdap}}
{{> Task :startLdap}}
{{{}Done with startLdap{}}}{{{}BUILD SUCCESSFUL in 1s{}}}
{{1 actionable task: 1 executed}}
{{ }}
{{$ ps -ef | grep pach}}
{{adam 42842 1 12 01:30 ? 00:00:06 /usr/bin/java
-Dapacheds.controls= -Dapacheds.extendedOperations=
-Dapacheds.intermediateResponses=
-Dlog4j.configuration=file:/home/adam/code/j20/ldap/app/apacheds-2.0.0.AM26/instances/default/conf/log4j.properties
-Dapacheds.shutdown.port=0
-Dapacheds.log.dir=/home/adam/code/j20/ldap/app/apacheds-2.0.0.AM26/instances/default/log
-classpath
/home/adam/code/j20/ldap/app/apacheds-2.0.0.AM26/lib/apacheds-service-2.0.0.AM26.jar
org.apache.directory.server.UberjarMain
/home/adam/code/j20/ldap/app/apacheds-2.0.0.AM26/instances/default}}
{{adam 42966 1 76 01:31 ? 00:00:05 /usr/bin/java
-Dapacheds.controls= -Dapacheds.extendedOperations=
-Dapacheds.intermediateResponses=
-Dlog4j.configuration=file:/home/adam/code/j20/ldap/app/apacheds-2.0.0.AM26/instances/default/conf/log4j.properties
-Dapacheds.shutdown.port=0
-Dapacheds.log.dir=/home/adam/code/j20/ldap/app/apacheds-2.0.0.AM26/instances/default/log
-classpath
/home/adam/code/j20/ldap/app/apacheds-2.0.0.AM26/lib/apacheds-service-2.0.0.AM26.jar
org.apache.directory.server.UberjarMain
/home/adam/code/j20/ldap/app/apacheds-2.0.0.AM26/instances/default}}
{{adam 42990 27739 0 01:31 pts/2 00:00:00 grep --color=auto pach}}
{{ }}
{{$ ps -ef | grep pach}}
{{adam 42842 1 8 01:30 ? 00:00:06 /usr/bin/java
-Dapacheds.controls= -Dapacheds.extendedOperations=
-Dapacheds.intermediateResponses=
-Dlog4j.configuration=file:/home/adam/code/j20/ldap/app/apacheds-2.0.0.AM26/instances/default/conf/log4j.properties
-Dapacheds.shutdown.port=0
-Dapacheds.log.dir=/home/adam/code/j20/ldap/app/apacheds-2.0.0.AM26/instances/default/log
-classpath
/home/adam/code/j20/ldap/app/apacheds-2.0.0.AM26/lib/apacheds-service-2.0.0.AM26.jar
org.apache.directory.server.UberjarMain
/home/adam/code/j20/ldap/app/apacheds-2.0.0.AM26/instances/default}}
{{adam 43009 27739 0 01:31 pts/2 00:00:00 grep --color=auto pach}}
{{ }}
{{$ cat ~/code/j20/ldap/app/latest/instances/default/run/apacheds.pid}}
{{42966}}
*==== end of console output ====*
*==== gradle script ====*
{{/// Constants / names / values}}
{{// def DS_VERSION='apacheds-2.0.0.AM26'}}
{{def DS_VERSION='latest'}}
{{def DS_EXECUTABLE='./apacheds.sh'}}
{{def DS_INSTANCE_NAME='default'}}
{{/// Directories}}
{{def HOME='/home/adam'}}
{{def IDM_BASE_FOLDER = "${HOME}/code/j20"}}
{{def SCRIPTS_BASE_FOLDER = "${HOME}/devops/j20"}}
{{def DS_HOME = "${IDM_BASE_FOLDER}/ldap/app/${DS_VERSION}"}}
{{def DS_DATA_HOME = "${DS_HOME}/instances"}}
{{tasks.register('startLdap', Exec) {}}
{{ group 'LDAP'}}
{{ description 'Starts the default LDAP server'}}{{ workingDir
"${DS_HOME}/bin"}}
{{ executable DS_EXECUTABLE}}
{{ args 'start'}}{{ doLast {}}
{{ println "Done with ${name}"}}
{{ }}}
{{} // startLdap}}
*==== end of gradle script ====*
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]