|
From: Leif M. <le...@ta...> - 2005-11-04 19:49:56
|
Richard,
I'll give this some more thought, but for now take a look at the
-Xrs Java parameter.
I think it will tell the JVM to ignore the logouts... It has some other
problems when used
for the JVM run by the Wrapper:
http://wrapper.tanukisoftware.org/doc/english/faq.html#3
Also, you are correct. The Wrapper can not handle more than one JVM
at this time.
Be aware that by launching a child JVM, the Wrapper will not be able to
manage it. If
the top level JVM crashes and is restarted by the Wrapper, the JVM that
you are
spawning could become a zombie process.
What are the settings that you are needing to change that require
you to launch a new
JVM? 3.2.0 makes this easier, but what about dynamically creating a second
wrapper.conf file then using that to start a second Wrapper as a second
service?
Then they would both be managed by the Wrapper directly?
Cheers,
Leif
Richard Emberson wrote:
> Lief,
>
> I think I partially know what the problem is and I'd like your advice
> on the solution
> I am proposing.
>
> First, the way we use the wrapper and java process is, no doubt, not
> the norm.
> The wrapper launches a Java Ant process. This Ant process then does a
> bunch
> of checks and startup activities. Then the Ant task executes a
> "parallel" Ant task,
> two different Ant threads within the running Ant process.
>
> The first thread calls the Ant "java" task launching JBoss. JBoss is
> launched in
> "fork" mode, a subprocess is forked. This is required since there are
> a bunch of
> arguments specific to the JBoss process that have to be passed to the
> JBoss process
> and if JBoss was not forked, then only the arguments passed to the
> original Ant
> process could be given to the JBoss process.
> The second thread then monitors the log files created by the JBoss
> process, making
> sure JBoss starts ok, dropping ear files after JBoss core has started
> and ensuring
> that our application started ok.
>
> The JBoss appserver has registered as a JMX page the
> org.tanukisoftware.wrapper.jmx.WrapperManager class.
> If as an argument to the JBoss process I pass in the property
> "wrapper.debug=true"
> then when I go to the JMX page for the first time I can see in the log
> that the
> WrapperManager is loaded (its not loaded until the JMX page is hit).
>
> Now, the WrapperManger running in the JBoss process does NOT have a
> listener
> registered and thats why the WRAPPER_CTRL_LOGOFF_EVENT is not
> handled but rather the JBoss process calls System.exit(status).
> This does not explain why on all of the other Windows systems running our
> application with the exact same setup do not die when folks logout,
> but that
> might be something how this particular Window system is configured.
>
> I could pass into the JBoss process the various wrapper properties so
> that when
> the WrapperManager class is intialized it tries to communicate with the
> wrapper process. The properties are available in the Ant task and can
> be passed
> to the JBoss as Java command line arguments (wrapper.key,
> wrapper.version,
> wrapper.native_library and wrapper.port). I suspect that this will not
> work - the
> wrapper is not designed to communicate with more than one Java process.
> I'm I correct that this will not work?
>
> Anyway, here here is my proposed solution.
> After the Ant task knows that our application is up and running, it
> does an http-get
> on the JMX console for the WrapperManager JMX page thus loading the
> WrapperManager. The WrapperManager is not given the wrapper.key so
> it does not try to communicate with the wrapper process. But, a
> Listener is
> regisered with the WrapperManager so that the WRAPPER_CTRL_LOGOFF_EVENT
> is ignored.
>
> What do you think?
>
> Richard
>
>
> Leif Mortenson wrote:
>
>> Richard,
>> I am pretty sure the logout events are only generated by the local
>> user who is
>> physically logged into the machine. I don't think it works the same
>> for remote
>> terminals. Don't have a remote accessible system immediately
>> available to test
>> with however.
>>
>> Cheers,
>> Leif
>>
>> Richard Emberson wrote:
>>
>>>
>>> On one of our windows machines the application is currently runing
>>> (a nightly build
>>> and run test). So I ssh in and tail the wraper log, then I vpn in
>>> logging in as a windows
>>> user. Then I log out and I do not see the message: "User logged
>>> out. Ignored."; there
>>> is nothing in the log indicating that I had logged out.
>>>
>>> How do I generate the user logout event on a windows machine (I'm
>>> rather Linux
>>> oriented)?
>>>
>>> Thanks
>>>
>>> Richard
>>>
>>> Leif Mortenson wrote:
>>>
>>>> Also what is happening while this is running? Are there user
>>>> accounts being logged in
>>>> and out?
>>>>
>>>> Cheers,
>>>> Leif
>>>>
>>>> Richard Emberson wrote:
>>>>
>>>>> The wrapper is being run as a service.
>>>>>
>>>>> The following is in the log file:
>>>>>
>>>>> INFO | jvm 5 | 2005/10/31 14:32:26 | [java] [Thr 4336]
>>>>> RFC Instrument: cosaccepttp reset uuid INFO | wrapper |
>>>>> 2005/10/31 14:37:19 | User logged out. Ignored.
>>>>> INFO | wrapper | 2005/10/31 14:37:19 | User logged out. Ignored.
>>>>> INFO | jvm 5 | 2005/10/31 14:37:20 | [java] Shutting down
>>>>> INFO | jvm 5 | 2005/10/31 14:37:20 | [java] Shutdown
>>>>> complete INFO | jvm 5 | 2005/10/31 14:37:20 |
>>>>> [java] Halting VM
>>>>> INFO | wrapper | 2005/10/31 14:37:20 | User logged out.
>>>>> Ignored. INFO | wrapper | 2005/10/31 14:37:20 | User
>>>>> logged out. Ignored.
>>>>> INFO | jvm 5 | 2005/10/31 14:38:23
>>>>> | INFO | jvm 5 |
>>>>> 2005/10/31 14:38:23 | BUILD SUCCESSFUL
>>>>> INFO | jvm 5 | 2005/10/31 14:38:23 | Total time: 5,938
>>>>> minutes 26 seconds ERROR | wrapper | 2005/10/31 14:38:24 | JVM
>>>>> exited unexpectedly.
>>>>> STATUS | wrapper | 2005/10/31 14:40:01 | Launching a
>>>>> JVM... INFO | jvm 6 | 2005/10/31 14:40:02 |
>>>>> Wrapper (Version 3.1.2) http://wrapper.tanukisoftware.org
>>>>> INFO | jvm 6 | 2005/10/31 14:40:02 | The first
>>>>> line is normal output from the application.
>>>>> The lines containing: "Shutting down", "Shutdown complete" and
>>>>> "Halting VM"
>>>>> are all being printed in the JBoss Shutdown Hook.
>>>>> The timing of the entries I would assume imply that they are all
>>>>> related, related
>>>>> to the user logout event. Something called System.exit() in the
>>>>> JBoss process -
>>>>> something triggered by the logout event - but how can that be if
>>>>> the wrapper
>>>>> is handling the event (as a code walkthru seems to indicate).
>>>>>
>>>>> Richard
>>>>> Leif Mortenson wrote:
>>>>>
>>>>>> Richard,
>>>>>> The "User logged out. Ignored." Messages show up when the
>>>>>> Wrapper is being run as
>>>>>> a service and an actual user who is logged in logs out to the
>>>>>> Windows login screen. The
>>>>>> service stays running in the background. This message is there
>>>>>> to help record the timing
>>>>>> of that event.
>>>>>> The message is displayed in response to a LOGOUT signal being
>>>>>> received from the
>>>>>> OS. Some Windows versions sent multiple signals, thus the
>>>>>> duplicate messages. It
>>>>>> is nothing to worry about and unrelated to shutdown.
>>>>>>
>>>>>> In this case, is what is happening is that your JBoss
>>>>>> application is calling System.exit
>>>>>> as it shuts down. Normally, this would cause the Wrapper to
>>>>>> exit as the application
>>>>>> had completed normally. When System.exit is called, the Java
>>>>>> executes all registered
>>>>>> shutdown hooks. The Wrapper registers such a shutdown hook to
>>>>>> handle the smooth
>>>>>> shutdown of the JVM.
>>>>>> The problem is that in your case, you have specifically
>>>>>> disabled the shutdown hooks.
>>>>>> When this is done, the Wrapper's shutdown hook is not run and the
>>>>>> Wrapper process
>>>>>> has no way of telling if the JVM crashed or shutdown
>>>>>> intentionally. So it states that
>>>>>> fact, assumes a crash and restarts the JVM.
>>>>>> Take a look at this page:
>>>>>> http://wrapper.tanukisoftware.org/doc/english/prop-disable-shutdown-hook.html
>>>>>>
>>>>>>
>>>>>> From your last sentence, it sounds like you are not expecting
>>>>>> the Java application
>>>>>> to be exiting? But that conflicts with what I am seeing in the
>>>>>> log file? Are you asking
>>>>>> why JBoss is shutting down in the first place?
>>>>>>
>>>>>> If you rerun your application with wrapper.debug=true then I
>>>>>> can tell you exactly
>>>>>> what is initiating the JVM shutdown (If it is being done by the
>>>>>> Wrapper). But I am
>>>>>> pretty sure your app is calling System.exit. Just not sure what
>>>>>> is initiating that.
>>>>>>
>>>>>> Cheers,
>>>>>> Leif
>>>>>>
>>>>>> Richard Emberson wrote:
>>>>>>
>>>>>>> I have the following in a wrapper log:
>>>>>>>
>>>>>>> INFO | wrapper | 2005/10/31 14:37:19 | User logged out.
>>>>>>> Ignored.
>>>>>>> INFO | wrapper | 2005/10/31 14:37:19 | User logged out.
>>>>>>> Ignored. INFO | jvm 5 | 2005/10/31 14:37:20 |
>>>>>>> [java] Shutting down
>>>>>>> INFO | jvm 5 | 2005/10/31 14:37:20 | [java] Shutdown
>>>>>>> complete INFO | jvm 5 | 2005/10/31 14:37:20 |
>>>>>>> [java] Halting VM
>>>>>>> INFO | wrapper | 2005/10/31 14:37:20 | User logged out.
>>>>>>> Ignored. INFO | wrapper | 2005/10/31 14:37:20 | User
>>>>>>> logged out. Ignored.
>>>>>>> INFO | jvm 5 | 2005/10/31 14:38:23
>>>>>>> | INFO | jvm 5 |
>>>>>>> 2005/10/31 14:38:23 | BUILD SUCCESSFUL
>>>>>>> INFO | jvm 5 | 2005/10/31 14:38:23 | Total time: 5,938
>>>>>>> minutes 26
>>>>>>> seconds
>>>>>>>
>>>>>>> ERROR | wrapper | 2005/10/31 14:38:24 | JVM exited unexpectedly.
>>>>>>> STATUS | wrapper | 2005/10/31 14:40:01 | Launching a
>>>>>>> JVM... INFO | jvm 6 | 2005/10/31 14:40:02 |
>>>>>>> Wrapper (Version 3.1.2) http://wrapper.tanukisoftware.org
>>>>>>>
>>>>>>> The line "Shutting down", "Sutdown complete" and "Halting VM"
>>>>>>> are being printed
>>>>>>> to standard out by a Shutdown Hook registered by JBoss, the
>>>>>>> application being
>>>>>>> controled by the wrapper.
>>>>>>>
>>>>>>> The "User logged out. Ignored" indicates that the wrapper is
>>>>>>> not being run in a
>>>>>>> console (looking at the source code) and when ignored, the
>>>>>>> wrapper does not
>>>>>>> kill its application. The wrapper then gones on to restart the
>>>>>>> application.
>>>>>>>
>>>>>>> Don't think its relevant, but:
>>>>>>> wrapper.disable_shutdown_hook=TRUE
>>>>>>>
>>>>>>> Why would there be multiple "User logged out. Ignored" lines?
>>>>>>>
>>>>>>> Any hints as to what mechanism(s) might lead to the wrapped
>>>>>>> application
>>>>>>> to stop?
>>>>>>>
>>>>>>> Thanks.
>>>>>>>
>>>>>>> Richard
>>>>>>>
|