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

Jiri Kremser jkremser at redhat.com
Tue Feb 12 18:31:45 UTC 2013


> BTW, the reason for Ctrl-C killing all processes is that the signal
> is sent to all processes in the same group.

We implement it manually in the AgentShutdownHook.interruptAllThreads().


if there is a way to limit the signal to only getting sent to the
> agent process (and not its child processes such that the child
> processes remain alive and running even after the parent process
> (the agent) dies), then that is something we should look into. I
> didn't think it was possible to do that, but if so, that would be
> great.

The problem here is that on the one hand we need to send SIGINT to the agent to clear its resources, on the other hand we don't want to send the SIGINT to the angent, because he will relay it to the all daemon threads (including the running standalone.sh (run by Java runtime)). So it is obviously contradictory. Something like "trap 'kill -9 myPid' INT" in the rhq.agent.sh would work, but it wouldn't clear the resources.

The only way, I am aware of, is using the & operator:

"nohup ./rhq-agent.sh --daemon &"  works well
"./run-in-background.sh ./standalone.sh" works well
or "Runtime.exec("standalone.sh &")" works well

check the att., I did a sequence diagram for it, because it is quite complex.


jk



----- Original Message -----
> From: "John Mazzitelli" <mazz at redhat.com>
> To: rhq-devel at lists.fedorahosted.org
> Sent: Tuesday, February 12, 2013 5:45:53 PM
> Subject: Re: AS is killed if the agent is killed (provided it was	started/restarted by the agent)
> 
> > BTW, the reason for Ctrl-C killing all processes is that the signal
> > is sent to all processes in the same group.
> 
> if there is a way to limit the signal to only getting sent to the
> agent process (and not its child processes such that the child
> processes remain alive and running even after the parent process
> (the agent) dies), then that is something we should look into. I
> didn't think it was possible to do that, but if so, that would be
> great.
> 
> But we should not eliminate the ability to control-C the agent
> itself.
> _______________________________________________
> rhq-devel mailing list
> rhq-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/rhq-devel
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RHQ-processes.png
Type: image/png
Size: 30232 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/rhq-devel/attachments/20130212/487f729d/attachment-0001.png>


More information about the rhq-devel mailing list