eclipse除錯postgre遇到的問題以及解決方法
阿新 • • 發佈:2019-01-19
ubuntu的版本為12.04 結果在用eclipse除錯postgres的子程序postgres的時候遇到了如下問題:
Could not attach to process. If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf
經過查閱有關資料發現,從ubuntu10.10開始,除非程序B是程序A的子程序,或者程序A為root執行,否則程序A不能除錯程序B。這樣一來增加了程序的安全。這個安全限制是預設的,但是可以通過修改配置檔案來達到任意程序A可以除錯程序B的目的。
1.可以通過下面的命令對這個限制進行臨時修改,但是重啟後限制依舊存在。
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
2.可以通過修改配置檔案來接觸限制
修改前:
kernel.yama.ptrace_scope = 1
修改後:
kernel.yama.ptrace_scope = 0
重啟之後可以生效