-
Notifications
You must be signed in to change notification settings - Fork 446
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
Access to JVM PID in universal package #168
Comments
Huh, look at #99. Can you explain what we broke with that fix? |
Not that I am a guru on this, but AFAIK the exec results in the original process (the script) being replaced with the called process (the JVM), meaning that the PID in $! actually is the PID of the JVM. I write that PID to a file and use it to kill the service later, when I want to start a new version. Currently I get the PID of the start script, and when I kill the script, the JVM continues to run. Maybe there other ways to achieve the same. It could also be an option to modify the script generation for java_server packages such that start/stop can be provided to the script and the script handles the PID. |
@kardapoltsev proposal looked like this: ${{exec_cmd}} "$java_cmd" And in bash script replacements smth like this: replacements ++= Seq("exec_cmd" -> (if(fork) "exec" else "")) However we only removed the @kodemaniak , can you post a minimal example for this? |
I made some tests with following results.
|
I've done the same tests but got different results. And from man page of exec I realize that it should be added back. But I need to test init.d script before.
@muuki88 Did you use pid file created by Play application in your tests? |
I've tested systemV start scripts with exec $java_cmd and now it works fine. |
Yes, play always creates its own PID. So I checked if the PID play outputs and the one thats running are the same. I didnt test it with a bootsystem, just on commandline. |
I assume, you don't need an example anymore? I guess what I am doing/experiencing is the same that @kardapoltsev tested. |
I will test it wil Upstart and SystemV again (just to make sure, that a commandline call is different than a call from the bootsystem). Is an option, like @kardapoltsev proposed in #99, neccessary or just adding it should be fine? |
I don't need the option, but if |
I was totally wrong when asking for removing exec. Now I've tested system V start script, bash script and read man exec. I think we should put in back. |
I think we're all in some kind of learning process here :P |
I am using the universal packager to build a zip for a backend service. Upon deployment I want to stop the old process before starting the new one. Unfortunately the script does not
exec
the java process, so the PID I can observe points to the script and does not terminate the JVM. Is there any workaround for that or can the script modified toexec
the JVM?The text was updated successfully, but these errors were encountered: