You can revert to the more permissive policy in one of two ways: 1) temporarily (until the next reboot) by changing the value to 0 in /proc/sys/kernel/yama/ptrace_scope, or 2) more permanently by changing the value to 0 in /etc/sysctl.d/10-ptrace.conf and rebooting. Option 1 does not require a reboot and option 2 does require a reboot.
Context: I was working on a script to use in the Jenkins Script Console to list all JVMs running across all slaves and to collect a thread dump from one of them:
Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: cannot open binary file
sun.jvm.hotspot.debugger.DebuggerException: sun.jvm.hotspot.debugger.DebuggerException: cannot open binary file
at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal$LinuxDebuggerLocalWorkerThread.execute(LinuxDebuggerLocal.java:163)
at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach(LinuxDebuggerLocal.java:278)
https://bugs.openjdk.java.net/browse/JDK-7050524?focusedCommentId=12450509&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12450509
Context: I was working on a script to use in the Jenkins Script Console to list all JVMs running across all slaves and to collect a thread dump from one of them:
This resulted in: