When the user of the PID to attach to is not a sudoer, one would expect
to be able to run the scripts as root (or as a different sudoer user). However due to the JDK bug
https://bugs.openjdk.java.net/browse/JDK-8036559, root cannot attach to
the JVM of another user. To address this, I’ve added a sudo to the
target user, so the scripts can be run as root (or another sudoer). This should be a no-op if you are
already that user.
When the user of the PID to attach to is not a sudoer, one would expect to be able to run the scripts as root (or as a different sudoer user). However due to the JDK bug https://bugs.openjdk.java.net/browse/JDK-8036559, root cannot attach to the JVM of another user. To address this, I’ve added a sudo to the target user, so the scripts can be run as root (or another sudoer). This should be a no-op if you are already that user.