2010-06-04 99 views
2

我有使用了C的方法如在Postgres數據庫功能的系統。當我嘗試用我的用戶帳戶運行gdb時,我得到: ptrace: Operation not permitted如何獲得調試postgres的權限?

它看起來像一個許可的事情。當我將gdb作爲「postgres」用戶運行時,它似乎工作正常。我想繼續將postgres作爲「postgres」用戶運行,而當我想要調試時,不需要su postgres。我可以以某種方式授予我的用戶帳戶「ptrace」對相關流程的權限嗎?把自己添加到「postgres」組似乎沒有幫助。

編輯:我發現這個人的ptrace頁面上:

 
EPERM The specified process cannot be traced. This could be because 
       the parent has insufficient privileges (the required capability 
       is CAP_SYS_PTRACE); non-root processes cannot trace processes 
       that they cannot send signals to or those running set-user- 
       ID/set-group-ID programs, for obvious reasons. Alternatively, 
       the process may already be being traced, or be init(8) (PID 1). 

那麼如何才能,我給CAP_SYS_TRACE特權,我的用戶?

+0

你最好問問這裏http://archives.postgresql.org/pgsql-hackers/ – leonbloy 2010-06-04 16:18:45

+0

您是否嘗試過ptrace的運行以根用戶或Postgres的? – teambob 2013-03-10 22:43:26

回答

2

看來CAP_SYS_TRACE由可能會或可能不會在您的計算機上安裝LIDS控制。

如果你正在做你可能更願意在自己的帳戶運行的Postgres的實例Postgres的比較大的發展 - 這是我做的一個數量的服務器,我的工作。