I'm trying to call this shell script using supervisord. supervisorctl reports the following error when trying to start the process:
kerby-kdc FATAL Exited too quickly (process log may have details)
I checked the kerby logs but no errors were reported.
I configured the process in /etc/supervisor/supervisord.conf
as follows:
[program:kerby-kdc]
command=bash -c "/home/test/kerberos/server/kdc-dist/bin/start-kdc.sh" /home/test/kerberos/server/kdc-dist/conf /home/test/kerberos/server/kdc-dist/runtime
user=test
environment=JAVA_HOME="/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64/bin"
autostart=true
autorestart=true
startsecs=10
startretries=3
Is there something wrong with this configuration?
CodePudding user response:
The shell script referenced in the OP contains the following:
java $DEBUG \
-classpath target/lib/*:. \
-DKERBY_LOGFILE=kdc \
org.apache.kerby.kerberos.kdc.KerbyKdcServer -start $args
Note that the classpath is relative. When supervisord tries to execute the java command, the JVM will be unable to find the class org.apache.kerby.kerberos.kdc.KerbyKdcServer
. That's because target/lib
doesn't exist relative to the supervisord execution path.
The classpath needs to be absolute or a CLASSPATH environment variable needs to be added to the supervisord.conf file.