|
From: Jimmy Chang(Gmail) <cha...@gm...> - 2011-08-26 13:42:10
|
I am currently using Java Service Wrapper Linux x86-64. When I execute "service mydaemon stop", the wrapper is killed, and my java daemon is then killed too. I have tried to modify mydaemon script with 'kill -2 pid', but in vain. How can make my java daemon to be shutdown gracefully? Thanks. |
|
From: Leif M. <lei...@ta...> - 2011-08-26 15:14:27
|
Jimmy, What version of the Wrapper are you using? Is the shell script from the same version? The Wrapper's shell script should be shutting down the Wrapper cleanly as you request. Please set the wrapper.debug=true property and then send us the resulting wrapper.log file. That may provide a clue as to what is happening. Cheers, Leif On Fri, Aug 26, 2011 at 10:41 PM, Jimmy Chang(Gmail) <cha...@gm...> wrote: > I am currently using Java Service Wrapper Linux x86-64. > When I execute "service mydaemon stop", the wrapper is killed, and my > java daemon is then killed too. > I have tried to modify mydaemon script with 'kill -2 pid', but in vain. > How can make my java daemon to be shutdown gracefully? > > Thanks. |
|
From: Jimmy Chang(Gmail) <cha...@gm...> - 2011-08-27 13:28:03
|
Hi Leif, I have a ShutdownHook in my java program, When I restart(stop) "mydaemon ", I hope the wrapper can wait my program to complete the shutdown procedures. Actually, when shutting down, I have only saw the log three times(15 secs): Waiting for mydaemon to exit... And the wrapper process and my java process have been killed. Here's the log. ERROR | wrapper | 2011/08/26 20:11:53 | Shutdown failed: Timed out waiting for the JVM to terminate. ERROR | wrapper | 2011/08/26 20:11:53 | JVM did not exit on request, terminated STATUS | wrapper | 2011/08/26 20:11:54 | <-- Wrapper Stopped STATUS | wrapper | 2011/08/26 20:17:49 | --> Wrapper Started as Daemon STATUS | wrapper | 2011/08/26 20:17:49 | Java Service Wrapper Community Edition 64-bit 3.5.10 STATUS | wrapper | 2011/08/26 20:17:49 | Copyright (C) 1999-2011 Tanuki Software, Ltd. All Rights Reserved. STATUS | wrapper | 2011/08/26 20:17:49 | http://wrapper.tanukisoftware.com STATUS | wrapper | 2011/08/26 20:17:49 | STATUS | wrapper | 2011/08/26 20:17:49 | Launching a JVM... Thanks. Jimmy |
|
From: Jimmy Chang(Gmail) <cha...@gm...> - 2011-08-27 13:50:31
|
Here's the complete logs. DEBUG | wrapperp | 2011/08/27 21:46:05 | read a packet PING : ping DEBUG | wrapper | 2011/08/27 21:46:07 | Signal trapped. Details: DEBUG | wrapper | 2011/08/27 21:46:07 | signal number=2 (SIGINT), source="kill, sigsend or raise" DEBUG | wrapper | 2011/08/27 21:46:07 | signal generated by PID: 7206 (Session PID: 6824), UID: 0 (root) STATUS | wrapper | 2011/08/27 21:46:07 | INT trapped. Shutting down. DEBUG | wrapper | 2011/08/27 21:46:07 | wrapperStopProcess(0, TRUE) called. DEBUG | wrapper | 2011/08/27 21:46:07 | Sending stop signal to JVM DEBUG | wrapperp | 2011/08/27 21:46:07 | send a packet STOP : NULL DEBUG | wrapperp | 2011/08/27 21:46:07 | read a packet STOPPED : 0 DEBUG | wrapper | 2011/08/27 21:46:07 | JVM signaled that it was stopped. DEBUG | wrapperp | 2011/08/27 21:46:07 | socket read no code (closed?). DEBUG | wrapperp | 2011/08/27 21:46:07 | closing backend socket. ERROR | wrapper | 2011/08/27 21:46:26 | Shutdown failed: Timed out waiting for the JVM to terminate. ERROR | wrapper | 2011/08/27 21:46:26 | JVM did not exit on request, terminated DEBUG | wrapper | 2011/08/27 21:46:26 | Signal trapped. Details: DEBUG | wrapper | 2011/08/27 21:46:26 | signal number=17 (SIGCHLD), source="unknown" DEBUG | wrapper | 2011/08/27 21:46:26 | Received SIGCHLD, checking JVM process status. STATUS | wrapper | 2011/08/27 21:46:26 | <-- Wrapper Stopped |
|
From: Jimmy Chang(Gmail) <cha...@gm...> - 2011-08-27 14:56:28
|
Hi all, I added the parameter and solved the problem. wrapper.jvm_exit.timeout=300 Thanks. > Here's the complete logs. > > DEBUG | wrapperp | 2011/08/27 21:46:05 | read a packet PING : ping > DEBUG | wrapper | 2011/08/27 21:46:07 | Signal trapped. Details: > DEBUG | wrapper | 2011/08/27 21:46:07 | signal number=2 (SIGINT), > source="kill, sigsend or raise" > DEBUG | wrapper | 2011/08/27 21:46:07 | signal generated by PID: 7206 > (Session PID: 6824), UID: 0 (root) > STATUS | wrapper | 2011/08/27 21:46:07 | INT trapped. Shutting down. > DEBUG | wrapper | 2011/08/27 21:46:07 | wrapperStopProcess(0, TRUE) > called. > DEBUG | wrapper | 2011/08/27 21:46:07 | Sending stop signal to JVM > DEBUG | wrapperp | 2011/08/27 21:46:07 | send a packet STOP : NULL > DEBUG | wrapperp | 2011/08/27 21:46:07 | read a packet STOPPED : 0 > DEBUG | wrapper | 2011/08/27 21:46:07 | JVM signaled that it was stopped. > DEBUG | wrapperp | 2011/08/27 21:46:07 | socket read no code (closed?). > DEBUG | wrapperp | 2011/08/27 21:46:07 | closing backend socket. > ERROR | wrapper | 2011/08/27 21:46:26 | Shutdown failed: Timed out > waiting for the JVM to terminate. > ERROR | wrapper | 2011/08/27 21:46:26 | JVM did not exit on request, > terminated > DEBUG | wrapper | 2011/08/27 21:46:26 | Signal trapped. Details: > DEBUG | wrapper | 2011/08/27 21:46:26 | signal number=17 (SIGCHLD), > source="unknown" > DEBUG | wrapper | 2011/08/27 21:46:26 | Received SIGCHLD, checking JVM > process status. > STATUS | wrapper | 2011/08/27 21:46:26 | <-- Wrapper Stopped |
|
From: Leif M. <lei...@ta...> - 2011-08-29 05:05:20
|
Jimmy, Great. That is what I was going to suggest. I would suggest not making that any longer than you really need as that is minimum time that the Wrapper will wait before it gives up and kills the JVM if it fails to shutdown for any reason. If it is too long it can cause delays getting your application back up and running after a long restart. Where possible, it is a good idea to try to modify your application to make its shutdown more responsive. That is not always possible however. Anyway, glad you got it working. Please let me know if we can be of further assistance. Cheers, Leif On Sat, Aug 27, 2011 at 11:55 PM, Jimmy Chang(Gmail) <cha...@gm...> wrote: > Hi all, > > I added the parameter and solved the problem. > > wrapper.jvm_exit.timeout=300 > > Thanks. > > >> Here's the complete logs. >> >> DEBUG | wrapperp | 2011/08/27 21:46:05 | read a packet PING : ping >> DEBUG | wrapper | 2011/08/27 21:46:07 | Signal trapped. Details: >> DEBUG | wrapper | 2011/08/27 21:46:07 | signal number=2 (SIGINT), >> source="kill, sigsend or raise" >> DEBUG | wrapper | 2011/08/27 21:46:07 | signal generated by PID: 7206 >> (Session PID: 6824), UID: 0 (root) >> STATUS | wrapper | 2011/08/27 21:46:07 | INT trapped. Shutting down. >> DEBUG | wrapper | 2011/08/27 21:46:07 | wrapperStopProcess(0, TRUE) >> called. >> DEBUG | wrapper | 2011/08/27 21:46:07 | Sending stop signal to JVM >> DEBUG | wrapperp | 2011/08/27 21:46:07 | send a packet STOP : NULL >> DEBUG | wrapperp | 2011/08/27 21:46:07 | read a packet STOPPED : 0 >> DEBUG | wrapper | 2011/08/27 21:46:07 | JVM signaled that it was stopped. >> DEBUG | wrapperp | 2011/08/27 21:46:07 | socket read no code (closed?). >> DEBUG | wrapperp | 2011/08/27 21:46:07 | closing backend socket. >> ERROR | wrapper | 2011/08/27 21:46:26 | Shutdown failed: Timed out >> waiting for the JVM to terminate. >> ERROR | wrapper | 2011/08/27 21:46:26 | JVM did not exit on request, >> terminated >> DEBUG | wrapper | 2011/08/27 21:46:26 | Signal trapped. Details: >> DEBUG | wrapper | 2011/08/27 21:46:26 | signal number=17 (SIGCHLD), >> source="unknown" >> DEBUG | wrapper | 2011/08/27 21:46:26 | Received SIGCHLD, checking JVM >> process status. >> STATUS | wrapper | 2011/08/27 21:46:26 | <-- Wrapper Stopped |