In some cases we've seen the JVM's Attach API listener go inexplicably missing during startup. Attempting to do a status, restart, or stop operation on such a system tends to result in a message like the following:
java.io.IOException: Connection refused
at sun.tools.attach.LinuxVirtualMachine.connect(Native Method)
Or sometimes this one:
Could not connect to the OpenNMS JVM (OpenNMS might not be running or could be starting up or shutting down): Failed to retrieve RMIServer stub: javax.naming.NameNotFoundException: jmxrmi
In environments where we've seen this behavior, adding the flag -XX:+StartAttachListener has resolved the problem at least in the short term. Assuming there's no downside, we should add this flag to ADDITIONAL_MANAGER_OPTIONS by default.