Description of problem: RHQ agent running JMX plugin (4.3.0-SNAPSHOT) seems to be sending kill -QUIT to all system Java processes. If Java is sending its own output to STDOUT, then the shell sends it to a file, then that file becomes corrupted. Version-Release number of selected component (if applicable): 4.3.0 How reproducible: Seemingly hard to reproduce. Doesn't seem to happen for all Java processes, oddly enough. Seems to happen on Linux JDK 1.6.0_30 and _16. Steps to Reproduce: 1. One way is to run the RHQ command line client as 'rhq' user. 2. Then run agent discovery through the agent command line as root user. Additional info: I'm guessing this happens through the attach API, although I am not clear what call does this. This is from the OpenJDK src/solaris/classes/sun/tools/attach/LinuxVirtualMachine.java // Find the socket file. If not found then we attempt to start the // attach mechanism in the target VM by sending it a QUIT signal. // Then we attempt to find the socket file again. path = findSocketFile(pid); if (path == null) { File f = createAttachFile(pid); try { // On LinuxThreads each thread is a process and we don't have the // pid of the VMThread which has SIGQUIT unblocked. To workaround // this we get the pid of the "manager thread" that is created // by the first call to pthread_create. This is parent of all // threads (except the initial thread). if (isLinuxThreads) { int mpid; try { mpid = getLinuxThreadsManager(pid); } catch (IOException x) { throw new AttachNotSupportedException(x.getMessage()); } assert(mpid >= 1); sendQuitToChildrenOf(mpid); } else { sendQuitTo(pid); } At the very least, there should be a way to disable this discovery mechanism or not attempt to attach to processes not explicitly requested.
per triage (crouch, loleary, foley). JON 3.1 timeframe. assign to ips.
Fixed in master: http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=1c1e9b9 It turns out the Java attach API can only discover java processes running as the same user. When running as root, it will send a SIGQUIT as part of an attempt to attach to a java process running as another user, but it ultimately fails to attach anyway. So I've updated the JMX Server discovery code so it no longer even tries to attach to java processes running as users other than the user the Agent is running as.
Ran agent as root and was able to add non-root jmx processes. will verify with brew build. JON 3.0.1.GA agent 4.2.0.JON.3.0.1.GA
verified in 3.1.0.GA -agent can discover any jmx enabled processes owned by others -agent only discover same owner processes with -Dorg.rhq.resourceKey see also https://bugzilla.redhat.com/show_bug.cgi?id=819116
Bulk closing of old issues in VERIFIED state.