AS is killed if the agent is killed (provided it was started/restarted by the agent)

John Mazzitelli mazz at redhat.com
Tue Feb 12 14:14:24 UTC 2013


> The good news is that this bug happens only if the agent is run by
> the rhq-agent.sh. Because rhq-agent-wrapper.sh runs in background,

For what it is worth, in production, we recommend people use rhq-server-wrapper.sh. In fact we expect and require people use it if they want to use the agent auto-update feature. This is clearly mentioned in the wiki docs under the section "Start the Agent Using the Wrapper Service" here:

https://docs.jboss.org/author/display/RHQ/RHQ+Agent+Installation#RHQAgentInstallation-StartTheAgentUsingTheWrapperService

Rarely will people want to run the agent in foreground (which is what rhq-agent.sh does) in a production box , because they normally start it via an init.d script. So I don't think this is a major issue for production users anyway.

----- Original Message -----
> Hi,
>   I tried your program and the AS survived, but if I add some waiting
>   after the Runtime.exec()[*], make a jar from it, run it in the
>   console and send it SIGINT (Ctrl+C) , it will kill the AS 7. All
>   the steps unfortunately happen in the real environment.
> 
> [*] http://pastebin.test.redhat.com/127325
> 
> The good news is that this bug happens only if the agent is run by
> the rhq-agent.sh. Because rhq-agent-wrapper.sh runs in background,
> it doesn't allow for pressing CTRL+C, but user can still send it the
> signal by calling kill -2 pid-of-the-agent. But it is less likely.
> That's probably why this bug hasn't been discovered yet, because
> customers use rhq-agent-wrappers for running it.
> 
> jk
>   
> 
> ----- Original Message -----
> > From: "Thomas Segismont" <tsegismo at redhat.com>
> > To: rhq-devel at lists.fedorahosted.org
> > Sent: Monday, February 11, 2013 6:44:13 PM
> > Subject: Re: AS is killed if the agent is killed (provided it was
> > 	started/restarted by the agent)
> > 
> > Hi Jiri,
> > 
> > I'm not sure it would be a good idea.
> > 
> > Orphan processes don't get killed automatically (it's true on
> > Windows
> > and on *nix). So I think we may do something wrong on the agent
> > side.
> > 
> > Just try this test case [1] (with appropriate values for your box)
> > and
> > try to connect to AS7 after JVM died, it will work.
> > 
> > [1] http://pastebin.test.redhat.com/127207
> > 
> > Thomas
> > 
> > Le 11/02/2013 16:21, Jiri Kremser a écrit :
> > > Hi,
> > >    wrt https://bugzilla.redhat.com/show_bug.cgi?id=909341
> > >
> > > I suggest 2 possible fixes.
> > >
> > > 1) To provide some intermediate simple script, for instance
> > > rhq-background-launcher.sh:
> > >
> > > #!/bin/sh
> > > $@&
> > >
> > > and then calling the launch script with
> > > ./rhq-background-launcher.sh ${path_to_standalone.sh}
> > > I was trying it and it solves the problem (trying it only in
> > > terminal, but it should work also for the case agent has executed
> > > the script).
> > >
> > > 2) Search for the "trap" commands in the launch script (they are
> > > the culprit) and comment them out before the execution, then
> > > uncomment them out (or create a temp. copy just for 1 usage).
> > >
> > >
> > > I think the fix should be hidden to the end user. If you have any
> > > other suggestions please respond to this email.
> > > JK
> > > _______________________________________________
> > > rhq-devel mailing list
> > > rhq-devel at lists.fedorahosted.org
> > > https://lists.fedorahosted.org/mailman/listinfo/rhq-devel
> > >
> > 
> > 
> > _______________________________________________
> > rhq-devel mailing list
> > rhq-devel at lists.fedorahosted.org
> > https://lists.fedorahosted.org/mailman/listinfo/rhq-devel
> >
> _______________________________________________
> rhq-devel mailing list
> rhq-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/rhq-devel
> 


More information about the rhq-devel mailing list