-
Notifications
You must be signed in to change notification settings - Fork 134
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
Adjust graylog entrypoint.sh with curl #187
Comments
I'm not clear what your I think you would want to set the env vars before the java command that starts Graylog. Something like:
Or even just put your |
Hello @malcyon I am trying below
which needs graylog to be up and functional, can you help me to here, I hope its clear now. Regards, |
Okay. I see. I think you need to daemonize Graylog itself for what you're doing to work. In the first example, the script will stop executing commands until Graylog exits. Not sure what's happening in the second example. It may be that Graylog is being backgrounded. And then when curl exits, the script is done, so Docker exits. Docker is really designed to run ONE command. When that command exits, the container is stopped. And then it might restart if your docker-compose is configured to do that. |
The problem is, if you were to daemonize Graylog, then the container would just exit. Docker is supposed to just run one command, and the container stops when that command exits. That's why all the stuff in our script runs before the If you daemonized Graylog, then ran your curl script, then had an infinite while loop in Bash after that, it might work. But then the container wouldn't stop properly. You'll probably have to accomplish this in a different way. A sidecar is a good idea, even though you said you didn't want to do that. |
Hello Team,
I was trying to bring curl command to bring some properties enabled once graylog is up but its not working for me
I tried below thing
graylog() {
exec "${JAVA_HOME}/bin/java"
${GRAYLOG_SERVER_JAVA_OPTS}
-jar
-Dlog4j.configurationFile="${GRAYLOG_HOME}/data/config/log4j2.xml"
-Djava.library.path="${GRAYLOG_HOME}/lib/sigar/"
-Dgraylog2.installation_source=docker
"${GRAYLOG_HOME}/graylog.jar"
server
-f "${GRAYLOG_HOME}/data/config/graylog.conf"
}
curl() {
curl something
}
run() {
setup
graylog
curl
}
run
but its not working , then I tried below thing
graylog() {
exec "${JAVA_HOME}/bin/java"
${GRAYLOG_SERVER_JAVA_OPTS}
-jar
-Dlog4j.configurationFile="${GRAYLOG_HOME}/data/config/log4j2.xml"
-Djava.library.path="${GRAYLOG_HOME}/lib/sigar/"
-Dgraylog2.installation_source=docker
"${GRAYLOG_HOME}/graylog.jar"
server
-f "${GRAYLOG_HOME}/data/config/graylog.conf" &&
curl something
}
it works command gets executed but container keeps on restarting , even I tried below thing s
graylog() {
"${JAVA_HOME}/bin/java"
${GRAYLOG_SERVER_JAVA_OPTS}
-jar
-Dlog4j.configurationFile="${GRAYLOG_HOME}/data/config/log4j2.xml"
-Djava.library.path="${GRAYLOG_HOME}/lib/sigar/"
-Dgraylog2.installation_source=docker
"${GRAYLOG_HOME}/graylog.jar"
server
-f "${GRAYLOG_HOME}/data/config/graylog.conf" &&
curl something
exec "$@"
}
it is also not working, can someone help me here how I can add curl after graylog is up in automated way, I tried to get help from community but no luck,
I dont want to use any operator or sidecar for this. please help I am sorry to for asking help in this manner.
Regards,
SAM
The text was updated successfully, but these errors were encountered: