There are other ways this could happen. For example, platform level
monitoring systems may decide to restart this agent by sending it the
SIGINT signal. From the sounds of it, this too would cause the issue
whether the agent is in the foreground or background?
If this happens when you run the agent using the recommended mechanism
(rhq-agent-wrapper.sh) then I agree this is a problem. If this is true, we need to know
this and fix it.
So, if someone starts the agent via rhq-agent-wrapper.sh, that agent starts an AS7, the
user then stops that agent, does the AS7 die? If so, that's a problem.