|
From: Leif M. <le...@ta...> - 2005-12-08 13:17:45
|
Nick, nic...@uk... wrote: > I am not too keen on having to enter the password in order to see usage.... > (its a bit anti-social....) > Ok..... I fixed it. > I notice that the "kill -9" is gone (if it timed out waiting for it to > stop...) > Is this no longer needed - or was there a problem with it? > That was actually a design flaw. I was trying to be overly careful with the script. The problem was that the sh script was waiting a maximum of 5 minutes before killing the wrapper process. Normally, the wrapper would never take that long to shut down so that would not be necessary anyway.. But if the user had configured the wrapper to have a longer shutdown timeout, say 10 minutes. (I did this to deal with a particular app). Then the script would timeout and forcibly kill the Wrapper process. The problem there is that because the Wrapper was waiting for the JVM to exit, the JVM is still left running. When using the "stop" command this may not be a problem because the JVM would usually shutdown correctly when it was done with what it was doing. The problem was if the "restart" command was passed to the script. The script was waiting 5 minutes, killing the Wrapper and then starting a new Wrapper, and thus, JVM instance. Because the first JVM was still running, the second JVM was failing to start due to port conflicts. Any long timeout would not work for someone. Assuming that the Wrapper process itself is not frozen, this timeout in the script should never be necessary as the Wrapper itself will timeout and kill a slow JVM. Pulling it out seems to be the correct thing to do. I have never seen or heard of the Wrapper process itself getting stuck shutting down. > The only other thing I have in my slightly customised wrapper script - > which I think is required - is: > > #... handle relative PIDDIR > > # Same test for WRAPPER_CMD > FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` > if [ "$FIRST_CHAR" != "/" ] > then > WRAPPER_CMD=$REALDIR/$WRAPPER_CMD > fi > > #... handle relative WRAPPER_CONF > Ok, I went ahead and added this. What were you doing that you found this to be necessary? I attached the new script. Please look it over again. Cheers, Leif |