|
From: Anat H. <an...@en...> - 2006-02-07 10:03:36
|
Hi, I'm trying to install my app as a Linux daemon. I used the 2nd integration method, and I'm running the wrapper through <app> start. My app runs fine, and continues to run after closing the console. However, it shuts down when I logout. Maybe I misunderstood, and it's not supposed to keep running? I've looked at the logs, and when I logout it seems the wrapper doesn't intercept the signal, and so my app shuts down. When stopping my app using <app> stop, I get this line in the log: TERM trapped. Shutting down. This msg is missing when I logout, but my app shuts down in both cases. Thanks, Anat -- Open WebMail Project (http://openwebmail.org) |
|
From: Anat H. <an...@en...> - 2006-02-07 11:15:25
|
--- I hope I'm not double-posting - I wasn't registered before... Hi, I'm trying to install my app as a Linux daemon. I used the 2nd integration method, and I'm running the wrapper through <app> start. My app runs fine, and continues to run after closing the console. However, it shuts down when I logout. Maybe I misunderstood, and it's not supposed to keep running? I've looked at the logs, and when I logout it seems the wrapper doesn't intercept the signal, and so my app shuts down. When stopping my app using <app> stop, I get this line in the log: TERM trapped. Shutting down. This msg is missing when I logout, but my app shuts down in both cases. Thanks, Anat |
|
From: Anat H. <an...@en...> - 2006-02-07 18:19:02
Attachments:
wrapper.log
|
Hi Leif, Attached is the log file. I hope it'll help. Thanks, Anat |
|
From: Leif M. <le...@ta...> - 2006-02-10 02:29:40
|
Anat,
Looking at your log file, this is the cause of the application being
shut down:
INFO | jvm 1 | 2006/02/07 16:42:51 | Processing control
event(WRAPPER_CTRL_SHUTDOWN_EVENT)
There is a bug in 3.1.2 where the JVM is not correctly ignoring TERM
signals
even if the IGNORE_SIGNALS flag is set in the sh script. This has been
fixed
for the unreleased 3.2.0. Could you please download and try out the latest
snapshot build and verify that this fixes the problem for you?
http://wrapper.tanukisoftware.org/tmp/3.1.2-d/wrapper-linux-x86-32-3.2.0-d.tar.gz
You will want to use the new sh script and set the IGNORE_SIGNALS
variable to true in the script.
Also, from your logs, it looks like there is a GUI being
displayed? That may
why your JVM is getting the TERM signals in the first place. In
general, daemon
processes don't have GUIs. You should add a call to
WrapperManager.isLaunchedAsService() This method will return true if the
Wrapper is running as a daemon process. Only show your GUI if it is false.
If you don't want to add a dependency to the wrapper API, look for the
"wrapper.service" system property.
Cheers,
Leif
Anat Halpern wrote:
> Hi Leif,
>
> Attached is the log file. I hope it'll help.
>
> Thanks,
> Anat
>
>
|
|
From: Anat H. <an...@en...> - 2006-02-14 14:05:28
|
Hi Leif, Thanks for your response. However, it doesn't seem to be working for me :'( Leif Mortenson wrote: > Anat, > Looking at your log file, this is the cause of the application > being shut down: > INFO | jvm 1 | 2006/02/07 16:42:51 | Processing control > event(WRAPPER_CTRL_SHUTDOWN_EVENT) > > There is a bug in 3.1.2 where the JVM is not correctly ignoring > TERM signals > even if the IGNORE_SIGNALS flag is set in the sh script. This has > been fixed > for the unreleased 3.2.0. Could you please download and try out the > latest > snapshot build and verify that this fixes the problem for you? > > > http://wrapper.tanukisoftware.org/tmp/3.1.2-d/wrapper-linux-x86-32-3.2.0-d.tar.gz > > > You will want to use the new sh script and set the IGNORE_SIGNALS > variable to true in the script. I've tried the new files, with the property set to true, but it still shutting down when I logout. Attached are 4 logs - for a console run, and service run which I stopped using <app> stop - those have normal behavior. The other 2 logs are of service runs during which I logout - one running remote through VNC, and the other is run locally. > > Also, from your logs, it looks like there is a GUI being > displayed? That may > why your JVM is getting the TERM signals in the first place. Could you explain about that? > In general, daemon > processes don't have GUIs. You should add a call to > WrapperManager.isLaunchedAsService() This method will return true if the > Wrapper is running as a daemon process. Only show your GUI if it is > false. > If you don't want to add a dependency to the wrapper API, look for the > "wrapper.service" system property. I'm not actually showing the GUI, it's hidden when in service mode - it's just a temporary (messy) solution before I remove the GUI. Is there a problem with that? Thanks, Anat > > Cheers, > Leif > > Anat Halpern wrote: >> Hi Leif, >> >> Attached is the log file. I hope it'll help. >> >> Thanks, >> Anat >> >> > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 > _______________________________________________ > Wrapper-user mailing list > Wra...@li... > https://lists.sourceforge.net/lists/listinfo/wrapper-user > > +++++++++++++++++++++++++++++++++++++++++++ > This Mail Was Scanned By Mail-seCure System > at the Tel-Aviv University CC. |
|
From: Leif M. <le...@ta...> - 2006-02-15 06:41:49
|
Anat,
You forgot to attach the 4 log files. I'll need to see them to
give you more help.
I was expecting this to be working with 3.2.0.
Also see my comments below.
Anat Halpern wrote:
> Hi Leif,
>
> Thanks for your response. However, it doesn't seem to be working for
> me :'(
>
> Leif Mortenson wrote:
>> Anat,
>> Looking at your log file, this is the cause of the application
>> being shut down:
>> INFO | jvm 1 | 2006/02/07 16:42:51 | Processing control
>> event(WRAPPER_CTRL_SHUTDOWN_EVENT)
>>
>> There is a bug in 3.1.2 where the JVM is not correctly ignoring
>> TERM signals
>> even if the IGNORE_SIGNALS flag is set in the sh script. This has
>> been fixed
>> for the unreleased 3.2.0. Could you please download and try out the
>> latest
>> snapshot build and verify that this fixes the problem for you?
>>
>>
>> http://wrapper.tanukisoftware.org/tmp/3.1.2-d/wrapper-linux-x86-32-3.2.0-d.tar.gz
>>
>>
>> You will want to use the new sh script and set the IGNORE_SIGNALS
>> variable to true in the script.
> I've tried the new files, with the property set to true, but it still
> shutting down when I logout. Attached are 4 logs - for a console run,
> and service run which I stopped using <app> stop - those have normal
> behavior. The other 2 logs are of service runs during which I logout -
> one running remote through VNC, and the other is run locally.
>>
>> Also, from your logs, it looks like there is a GUI being
>> displayed? That may
>> why your JVM is getting the TERM signals in the first place.
> Could you explain about that?
I saw references to the "AgentFrame" class in your wrapper.log. I assumed
that this was referring to a GUI Frame.
>> In general, daemon
>> processes don't have GUIs. You should add a call to
>> WrapperManager.isLaunchedAsService() This method will return true if
>> the
>> Wrapper is running as a daemon process. Only show your GUI if it is
>> false.
>> If you don't want to add a dependency to the wrapper API, look for the
>> "wrapper.service" system property.
> I'm not actually showing the GUI, it's hidden when in service mode -
> it's just a temporary (messy) solution before I remove the GUI. Is
> there a problem with that?
If it is not being shown, that should be fine. I was thinking that that
might be
the reason why you were getting the TERM signal.
Cheers,
Leif
|
|
From: Anat H. <an...@en...> - 2006-02-15 08:39:15
Attachments:
logs_zip
|
Apparently, sourceforge is blocking zip file attachments, ans also attachment size is limited to 40K. So I'll try the zip again (just change the extension). -- Open WebMail Project (http://openwebmail.org) ---------- Original Message ----------- From: Leif Mortenson <le...@ta...> To: wra...@li... Sent: Wed, 15 Feb 2006 15:41:45 +0900 Subject: Re: [Wrapper-user] Linux daemon question > Anat, > You forgot to attach the 4 log files. I'll need to see them to > give you more help. > I was expecting this to be working with 3.2.0. > > Also see my comments below. > > Anat Halpern wrote: > > Hi Leif, > > > > Thanks for your response. However, it doesn't seem to be working for > > me :'( > > > > Leif Mortenson wrote: > >> Anat, > >> Looking at your log file, this is the cause of the application > >> being shut down: > >> INFO | jvm 1 | 2006/02/07 16:42:51 | Processing control > >> event(WRAPPER_CTRL_SHUTDOWN_EVENT) > >> > >> There is a bug in 3.1.2 where the JVM is not correctly ignoring > >> TERM signals > >> even if the IGNORE_SIGNALS flag is set in the sh script. This has > >> been fixed > >> for the unreleased 3.2.0. Could you please download and try out the > >> latest > >> snapshot build and verify that this fixes the problem for you? > >> > >> > >> http://wrapper.tanukisoftware.org/tmp/3.1.2-d/wrapper-linux-x86-32-3.2.0-d.tar.gz > >> > >> > >> You will want to use the new sh script and set the IGNORE_SIGNALS > >> variable to true in the script. > > I've tried the new files, with the property set to true, but it still > > shutting down when I logout. Attached are 4 logs - for a console run, > > and service run which I stopped using <app> stop - those have normal > > behavior. The other 2 logs are of service runs during which I logout - > > one running remote through VNC, and the other is run locally. > >> > >> Also, from your logs, it looks like there is a GUI being > >> displayed? That may > >> why your JVM is getting the TERM signals in the first place. > > Could you explain about that? > I saw references to the "AgentFrame" class in your wrapper.log. I assumed > that this was referring to a GUI Frame. > >> In general, daemon > >> processes don't have GUIs. You should add a call to > >> WrapperManager.isLaunchedAsService() This method will return true if > >> the > >> Wrapper is running as a daemon process. Only show your GUI if it is > >> false. > >> If you don't want to add a dependency to the wrapper API, look for the > >> "wrapper.service" system property. > > I'm not actually showing the GUI, it's hidden when in service mode - > > it's just a temporary (messy) solution before I remove the GUI. Is > > there a problem with that? > If it is not being shown, that should be fine. I was thinking that that > might be > the reason why you were getting the TERM signal. It's hidden. I just don't understand should be the reason for the signal - sorry for the ignorance... > > Cheers, > Leif > ------- End of Original Message ------- Thanks, Anat |
|
From: Leif M. <le...@ta...> - 2006-02-23 14:28:36
|
Anat,
Sorry for the delay. wrapper.log.service_normal and wrapper.log.console
are the runs that work correctly right? They both appear to be running and
shutting down correctly.
Both wrapper.log.service_local_logout and wrapper.log.service_vnc_logout
Contain output like the following:
DEBUG | wrapper | 2006/02/14 16:20:45 | Signal trapped. Details:
DEBUG | wrapper | 2006/02/14 16:20:45 | signal number=17 (SIGCHLD),
source="unknown"
DEBUG | wrapper | 2006/02/14 16:20:45 | Received SIGCHLD, calling wait().
DEBUG | wrapper | 2006/02/14 16:20:45 | wait() returned, child process
should be gone.
DEBUG | wrapper | 2006/02/14 16:20:45 | Signal trapped. Details:
DEBUG | wrapper | 2006/02/14 16:20:45 | signal number=17 (SIGCHLD),
source="unknown"
DEBUG | wrapper | 2006/02/14 16:20:45 | Received SIGCHLD, calling wait().
DEBUG | wrapper | 2006/02/14 16:20:45 | wait() returned, child process
should be gone.
DEBUG | wrapperp | 2006/02/14 16:20:45 | socket read no code (closed?).
DEBUG | wrapper | 2006/02/14 16:20:45 | JVM process is gone.
ERROR | wrapper | 2006/02/14 16:20:45 | JVM exited unexpectedly.
The JVM appears to be running along perfectly normally then its process
suddenly terminates. The Wrapper is not shutting it down. It just dies
as if
it crashed or its process was killed with 'kill -9'. The Wrapper is
viewing this
as a crash and attempts to restart the application.
It restarts the Java process successfully, but the application is
throwing
an exception because it is not able to display a window because a display
no longer exists:
INFO | jvm 2 | 2006/02/14 16:20:57 | Caused by:
java.lang.InternalError: Can't connect to X11 window server using
'jupiter.eng.tau.ac.il:8.0' as the value of the DISPLAY variable.
INFO | jvm 2 | 2006/02/14 16:20:57 | at
sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
Since this is happening on a restart, I assume that this means that the
original invocation also had a window up? It may be that the window is
system is sending a kill -9 to all processes with windows that do not
shutdown on their own when the Window manager shuts down the display.
I will have to play around with trying to reproduce this. But it
may depend
on the window manager you are using.
I mentioned this before, but add code like the following in your code to
make sure that your application never shows a gui when it is being run as
a daemon / service process:
if ( WrapperManager.isLaunchedAsService() )
{
// Windowless mode
}
else
{
// Show GUI.
}
Cheers,
Leif
Anat Halpern wrote:
> Apparently, sourceforge is blocking zip file attachments, ans also attachment size is
> limited to 40K. So I'll try the zip again (just change the extension).
> --
> Open WebMail Project (http://openwebmail.org)
>
>
> ---------- Original Message -----------
> From: Leif Mortenson <le...@ta...>
> To: wra...@li...
> Sent: Wed, 15 Feb 2006 15:41:45 +0900
> Subject: Re: [Wrapper-user] Linux daemon question
>
>
>> Anat,
>> You forgot to attach the 4 log files. I'll need to see them to
>> give you more help.
>> I was expecting this to be working with 3.2.0.
>>
>> Also see my comments below.
>>
>> Anat Halpern wrote:
>>
>>> Hi Leif,
>>>
>>> Thanks for your response. However, it doesn't seem to be working for
>>> me :'(
>>>
>>> Leif Mortenson wrote:
>>>
>>>> Anat,
>>>> Looking at your log file, this is the cause of the application
>>>> being shut down:
>>>> INFO | jvm 1 | 2006/02/07 16:42:51 | Processing control
>>>> event(WRAPPER_CTRL_SHUTDOWN_EVENT)
>>>>
>>>> There is a bug in 3.1.2 where the JVM is not correctly ignoring
>>>> TERM signals
>>>> even if the IGNORE_SIGNALS flag is set in the sh script. This has
>>>> been fixed
>>>> for the unreleased 3.2.0. Could you please download and try out the
>>>> latest
>>>> snapshot build and verify that this fixes the problem for you?
>>>>
>>>>
>>>> http://wrapper.tanukisoftware.org/tmp/3.1.2-d/wrapper-linux-x86-32-3.2.0-d.tar.gz
>>>>
>>>>
>>>> You will want to use the new sh script and set the IGNORE_SIGNALS
>>>> variable to true in the script.
>>>>
>>> I've tried the new files, with the property set to true, but it still
>>> shutting down when I logout. Attached are 4 logs - for a console run,
>>> and service run which I stopped using <app> stop - those have normal
>>> behavior. The other 2 logs are of service runs during which I logout -
>>> one running remote through VNC, and the other is run locally.
>>>
>>>> Also, from your logs, it looks like there is a GUI being
>>>> displayed? That may
>>>> why your JVM is getting the TERM signals in the first place.
>>>>
>>> Could you explain about that?
>>>
>> I saw references to the "AgentFrame" class in your wrapper.log. I assumed
>> that this was referring to a GUI Frame.
>>
>>>> In general, daemon
>>>> processes don't have GUIs. You should add a call to
>>>> WrapperManager.isLaunchedAsService() This method will return true if
>>>> the
>>>> Wrapper is running as a daemon process. Only show your GUI if it is
>>>> false.
>>>> If you don't want to add a dependency to the wrapper API, look for the
>>>> "wrapper.service" system property.
>>>>
>>> I'm not actually showing the GUI, it's hidden when in service mode -
>>> it's just a temporary (messy) solution before I remove the GUI. Is
>>> there a problem with that?
>>>
>> If it is not being shown, that should be fine. I was thinking that that
>> might be
>> the reason why you were getting the TERM signal.
>>
> It's hidden. I just don't understand should be the reason for the signal - sorry for the
> ignorance...
>
>> Cheers,
>> Leif
>>
>>
> ------- End of Original Message -------
>
> Thanks,
> Anat
>
>
|
|
From: Anat H. <an...@en...> - 2006-02-23 17:33:04
|
Thanks for your help, Leif.
The process terminates when I logout, or at least that's how it seems. I
know the wrapper is not shutting it down, however I thought the wrapper
is supposed to intercept those signals so that the JVM doesn't get them.
I think the wrapper wouldn't be able to restart the application for
other reasons as well, but in any case restarting is not the solution
for this problem.
The original invocation also had a window, but hidden. I am checking
whether running in service mode, and if so I have the window hidden.
This is currently easier for me to do than to disentangle the GUI code
from the application. I plan to separate them, but I hope it will not be
necessary to do it now. Please let me know if it is...
Cheers,
Anat
Leif Mortenson wrote:
> Anat,
> Sorry for the delay. wrapper.log.service_normal and
> wrapper.log.console
> are the runs that work correctly right? They both appear to be
> running and
> shutting down correctly.
>
> Both wrapper.log.service_local_logout and
> wrapper.log.service_vnc_logout
> Contain output like the following:
> DEBUG | wrapper | 2006/02/14 16:20:45 | Signal trapped. Details:
> DEBUG | wrapper | 2006/02/14 16:20:45 | signal number=17
> (SIGCHLD), source="unknown"
> DEBUG | wrapper | 2006/02/14 16:20:45 | Received SIGCHLD, calling
> wait().
> DEBUG | wrapper | 2006/02/14 16:20:45 | wait() returned, child
> process should be gone.
> DEBUG | wrapper | 2006/02/14 16:20:45 | Signal trapped. Details:
> DEBUG | wrapper | 2006/02/14 16:20:45 | signal number=17
> (SIGCHLD), source="unknown"
> DEBUG | wrapper | 2006/02/14 16:20:45 | Received SIGCHLD, calling
> wait().
> DEBUG | wrapper | 2006/02/14 16:20:45 | wait() returned, child
> process should be gone.
> DEBUG | wrapperp | 2006/02/14 16:20:45 | socket read no code (closed?).
> DEBUG | wrapper | 2006/02/14 16:20:45 | JVM process is gone.
> ERROR | wrapper | 2006/02/14 16:20:45 | JVM exited unexpectedly.
>
> The JVM appears to be running along perfectly normally then its
> process
> suddenly terminates. The Wrapper is not shutting it down. It just
> dies as if
> it crashed or its process was killed with 'kill -9'. The Wrapper is
> viewing this
> as a crash and attempts to restart the application.
> It restarts the Java process successfully, but the application is
> throwing
> an exception because it is not able to display a window because a display
> no longer exists:
> INFO | jvm 2 | 2006/02/14 16:20:57 | Caused by:
> java.lang.InternalError: Can't connect to X11 window server using
> 'jupiter.eng.tau.ac.il:8.0' as the value of the DISPLAY variable.
> INFO | jvm 2 | 2006/02/14 16:20:57 | at
> sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
>
> Since this is happening on a restart, I assume that this means that
> the
> original invocation also had a window up? It may be that the window is
> system is sending a kill -9 to all processes with windows that do not
> shutdown on their own when the Window manager shuts down the display.
> I will have to play around with trying to reproduce this. But it
> may depend
> on the window manager you are using.
>
> I mentioned this before, but add code like the following in your
> code to
> make sure that your application never shows a gui when it is being run as
> a daemon / service process:
>
> if ( WrapperManager.isLaunchedAsService() )
> {
> // Windowless mode
> }
> else
> {
> // Show GUI.
> }
>
> Cheers,
> Leif
>
>
>
> Anat Halpern wrote:
>> Apparently, sourceforge is blocking zip file attachments, ans also
>> attachment size is
>> limited to 40K. So I'll try the zip again (just change the extension).
>> --
>> Open WebMail Project (http://openwebmail.org)
>>
>>
>> ---------- Original Message -----------
>> From: Leif Mortenson <le...@ta...>
>> To: wra...@li...
>> Sent: Wed, 15 Feb 2006 15:41:45 +0900
>> Subject: Re: [Wrapper-user] Linux daemon question
>>
>>
>>> Anat,
>>> You forgot to attach the 4 log files. I'll need to see them to
>>> give you more help.
>>> I was expecting this to be working with 3.2.0.
>>>
>>> Also see my comments below.
>>>
>>> Anat Halpern wrote:
>>>
>>>> Hi Leif,
>>>>
>>>> Thanks for your response. However, it doesn't seem to be working
>>>> for me :'(
>>>>
>>>> Leif Mortenson wrote:
>>>>
>>>>> Anat,
>>>>> Looking at your log file, this is the cause of the application
>>>>> being shut down:
>>>>> INFO | jvm 1 | 2006/02/07 16:42:51 | Processing control
>>>>> event(WRAPPER_CTRL_SHUTDOWN_EVENT)
>>>>>
>>>>> There is a bug in 3.1.2 where the JVM is not correctly ignoring
>>>>> TERM signals
>>>>> even if the IGNORE_SIGNALS flag is set in the sh script. This has
>>>>> been fixed
>>>>> for the unreleased 3.2.0. Could you please download and try out
>>>>> the latest
>>>>> snapshot build and verify that this fixes the problem for you?
>>>>>
>>>>>
>>>>> http://wrapper.tanukisoftware.org/tmp/3.1.2-d/wrapper-linux-x86-32-3.2.0-d.tar.gz
>>>>>
>>>>>
>>>>> You will want to use the new sh script and set the IGNORE_SIGNALS
>>>>> variable to true in the script.
>>>>>
>>>> I've tried the new files, with the property set to true, but it
>>>> still shutting down when I logout. Attached are 4 logs - for a
>>>> console run, and service run which I stopped using <app> stop -
>>>> those have normal behavior. The other 2 logs are of service runs
>>>> during which I logout - one running remote through VNC, and the
>>>> other is run locally.
>>>>
>>>>> Also, from your logs, it looks like there is a GUI being
>>>>> displayed? That may
>>>>> why your JVM is getting the TERM signals in the first place.
>>>>>
>>>> Could you explain about that?
>>>>
>>> I saw references to the "AgentFrame" class in your wrapper.log. I
>>> assumed
>>> that this was referring to a GUI Frame.
>>>
>>>>> In general, daemon
>>>>> processes don't have GUIs. You should add a call to
>>>>> WrapperManager.isLaunchedAsService() This method will return true
>>>>> if the
>>>>> Wrapper is running as a daemon process. Only show your GUI if it
>>>>> is false.
>>>>> If you don't want to add a dependency to the wrapper API, look for
>>>>> the
>>>>> "wrapper.service" system property.
>>>>>
>>>> I'm not actually showing the GUI, it's hidden when in service mode
>>>> - it's just a temporary (messy) solution before I remove the GUI.
>>>> Is there a problem with that?
>>>>
>>> If it is not being shown, that should be fine. I was thinking that
>>> that might be
>>> the reason why you were getting the TERM signal.
>>>
>> It's hidden. I just don't understand should be the reason for the
>> signal - sorry for the
>> ignorance...
>>
>>> Cheers,
>>> Leif
>>>
>>>
>> ------- End of Original Message -------
>>
>> Thanks,
>> Anat
>>
>>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting
> language
> that extends applications into web and mobile media. Attend the live
> webcast
> and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Wrapper-user mailing list
> Wra...@li...
> https://lists.sourceforge.net/lists/listinfo/wrapper-user
>
> +++++++++++++++++++++++++++++++++++++++++++
> This Mail Was Scanned By Mail-seCure System
> at the Tel-Aviv University CC.
|
|
From: Leif M. <le...@ta...> - 2006-02-24 02:10:29
|
Anat,
> The process terminates when I logout, or at least that's how it seems.
> I know the wrapper is not shutting it down, however I thought the
> wrapper is supposed to intercept those signals so that the JVM doesn't
> get them.
The Wrapper is capable of catching and handling many signals, but the JVM
is a separate child process of the Wrapper. If it receives a kill -9,
there is not
anything that can be done about it. At that point, the os is killing
the process
at a very low level. This is true on Windows as well if the user kills
the java
process from the task manager. Processes in both platforms are protected
by user privileges. But if the user has the privilege to kill the
process, it goes
bye bye.
> I think the wrapper wouldn't be able to restart the application for
> other reasons as well, but in any case restarting is not the solution
> for this problem.
I agree, the reason for the restart not working makes sense in your case.
The question is, who is killing the initial java process?
> The original invocation also had a window, but hidden. I am checking
> whether running in service mode, and if so I have the window hidden.
> This is currently easier for me to do than to disentangle the GUI code
> from the application. I plan to separate them, but I hope it will not
> be necessary to do it now. Please let me know if it is...
I wonder if the JVM is creating some hooks into the window manager simply
by allocating the resources for a window, even if that window is not being
displayed?
Could you create a simple headless application and try this out on your
machine? I would like to find out if this is being caused by hidden GUI.
I'll try this out on my home linux machine over the weekend. I only have
access to remote systems today.
Cheers,
Leif
> Leif Mortenson wrote:
>> Anat,
>> Sorry for the delay. wrapper.log.service_normal and
>> wrapper.log.console
>> are the runs that work correctly right? They both appear to be
>> running and
>> shutting down correctly.
>>
>> Both wrapper.log.service_local_logout and
>> wrapper.log.service_vnc_logout
>> Contain output like the following:
>> DEBUG | wrapper | 2006/02/14 16:20:45 | Signal trapped. Details:
>> DEBUG | wrapper | 2006/02/14 16:20:45 | signal number=17
>> (SIGCHLD), source="unknown"
>> DEBUG | wrapper | 2006/02/14 16:20:45 | Received SIGCHLD, calling
>> wait().
>> DEBUG | wrapper | 2006/02/14 16:20:45 | wait() returned, child
>> process should be gone.
>> DEBUG | wrapper | 2006/02/14 16:20:45 | Signal trapped. Details:
>> DEBUG | wrapper | 2006/02/14 16:20:45 | signal number=17
>> (SIGCHLD), source="unknown"
>> DEBUG | wrapper | 2006/02/14 16:20:45 | Received SIGCHLD, calling
>> wait().
>> DEBUG | wrapper | 2006/02/14 16:20:45 | wait() returned, child
>> process should be gone.
>> DEBUG | wrapperp | 2006/02/14 16:20:45 | socket read no code (closed?).
>> DEBUG | wrapper | 2006/02/14 16:20:45 | JVM process is gone.
>> ERROR | wrapper | 2006/02/14 16:20:45 | JVM exited unexpectedly.
>>
>> The JVM appears to be running along perfectly normally then its
>> process
>> suddenly terminates. The Wrapper is not shutting it down. It just
>> dies as if
>> it crashed or its process was killed with 'kill -9'. The Wrapper is
>> viewing this
>> as a crash and attempts to restart the application.
>> It restarts the Java process successfully, but the application is
>> throwing
>> an exception because it is not able to display a window because a
>> display
>> no longer exists:
>> INFO | jvm 2 | 2006/02/14 16:20:57 | Caused by:
>> java.lang.InternalError: Can't connect to X11 window server using
>> 'jupiter.eng.tau.ac.il:8.0' as the value of the DISPLAY variable.
>> INFO | jvm 2 | 2006/02/14 16:20:57 | at
>> sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
>>
>> Since this is happening on a restart, I assume that this means
>> that the
>> original invocation also had a window up? It may be that the window is
>> system is sending a kill -9 to all processes with windows that do not
>> shutdown on their own when the Window manager shuts down the display.
>> I will have to play around with trying to reproduce this. But it
>> may depend
>> on the window manager you are using.
>>
>> I mentioned this before, but add code like the following in your
>> code to
>> make sure that your application never shows a gui when it is being
>> run as
>> a daemon / service process:
>>
>> if ( WrapperManager.isLaunchedAsService() )
>> {
>> // Windowless mode
>> }
>> else
>> {
>> // Show GUI.
>> }
>>
>> Cheers,
>> Leif
<snip history>
|
|
From: Anat H. <an...@en...> - 2006-02-26 10:58:36
Attachments:
GuiTest_zip
|
Hi Leif, It seems you were right - the window is causing this :-( I'm attaching 2 log files - one is with a hidden window, and one wo GUI. The first shuts down on logout, while the second continues. Leif Mortenson wrote: > Anat, >> The process terminates when I logout, or at least that's how it >> seems. I know the wrapper is not shutting it down, however I thought >> the wrapper is supposed to intercept those signals so that the JVM >> doesn't get them. > The Wrapper is capable of catching and handling many signals, but the JVM > is a separate child process of the Wrapper. If it receives a kill -9, > there is not > anything that can be done about it. At that point, the os is killing > the process > at a very low level. This is true on Windows as well if the user > kills the java > process from the task manager. Processes in both platforms are protected > by user privileges. But if the user has the privilege to kill the > process, it goes > bye bye. >> I think the wrapper wouldn't be able to restart the application for >> other reasons as well, but in any case restarting is not the solution >> for this problem. > I agree, the reason for the restart not working makes sense in your case. > The question is, who is killing the initial java process? >> The original invocation also had a window, but hidden. I am checking >> whether running in service mode, and if so I have the window hidden. >> This is currently easier for me to do than to disentangle the GUI >> code from the application. I plan to separate them, but I hope it >> will not be necessary to do it now. Please let me know if it is... > I wonder if the JVM is creating some hooks into the window manager simply > by allocating the resources for a window, even if that window is not > being > displayed? > > Could you create a simple headless application and try this out on your > machine? I would like to find out if this is being caused by hidden GUI. > so I'd have to disconnect the GUI, or do you have some other solution in mind? > I'll try this out on my home linux machine over the weekend. I only have > access to remote systems today. > > Cheers, > Leif > Thanks, Anat |
|
From: Anat H. <an...@en...> - 2006-03-08 07:41:34
|
Hi again, I didn't get any reply to my last question, so I'm gonna nag again: Is there any way I can avoid disconnecting the GUI, and still have the service functioning on Linux? Any idea is welcome. Thanks, Anat Anat Halpern wrote: > Hi Leif, > It seems you were right - the window is causing this :-( > I'm attaching 2 log files - one is with a hidden window, and one wo > GUI. The first shuts down on logout, while the second continues. > > Leif Mortenson wrote: >> Anat, >>> The process terminates when I logout, or at least that's how it >>> seems. I know the wrapper is not shutting it down, however I thought >>> the wrapper is supposed to intercept those signals so that the JVM >>> doesn't get them. >> The Wrapper is capable of catching and handling many signals, but the >> JVM >> is a separate child process of the Wrapper. If it receives a kill >> -9, there is not >> anything that can be done about it. At that point, the os is killing >> the process >> at a very low level. This is true on Windows as well if the user >> kills the java >> process from the task manager. Processes in both platforms are >> protected >> by user privileges. But if the user has the privilege to kill the >> process, it goes >> bye bye. >>> I think the wrapper wouldn't be able to restart the application for >>> other reasons as well, but in any case restarting is not the >>> solution for this problem. >> I agree, the reason for the restart not working makes sense in your >> case. >> The question is, who is killing the initial java process? >>> The original invocation also had a window, but hidden. I am checking >>> whether running in service mode, and if so I have the window hidden. >>> This is currently easier for me to do than to disentangle the GUI >>> code from the application. I plan to separate them, but I hope it >>> will not be necessary to do it now. Please let me know if it is... >> I wonder if the JVM is creating some hooks into the window manager >> simply >> by allocating the resources for a window, even if that window is not >> being >> displayed? >> >> Could you create a simple headless application and try this out on your >> machine? I would like to find out if this is being caused by hidden >> GUI. >> > so I'd have to disconnect the GUI, or do you have some other solution > in mind? >> I'll try this out on my home linux machine over the weekend. I only >> have >> access to remote systems today. >> >> Cheers, >> Leif >> > Thanks, > Anat > > > +++++++++++++++++++++++++++++++++++++++++++ > This Mail Was Scanned By Mail-seCure System > at the Tel-Aviv University CC. |
|
From: Leif M. <le...@ta...> - 2006-02-07 11:02:49
|
Anat,
That shouldn't be happening, but I can't tell the cause from what
you posted.
Could you add the wrapper.debug=true property, delete your wrapper.log file
and then reproduce this. Post back with the resulting log file.
Cheers,
Leif
Anat Halpern wrote:
> Hi,
>
> I'm trying to install my app as a Linux daemon. I used the 2nd integration method, and I'm
> running the wrapper through <app> start. My app runs fine, and continues to run after
> closing the console. However, it shuts down when I logout. Maybe I misunderstood, and it's
> not supposed to keep running?
> I've looked at the logs, and when I logout it seems the wrapper doesn't intercept the
> signal, and so my app shuts down. When stopping my app using <app> stop, I get this line
> in the log:
> TERM trapped. Shutting down.
> This msg is missing when I logout, but my app shuts down in both cases.
>
> Thanks,
> Anat
>
|