2010-06-04 98 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的比较大的发展 - 这是我做的一个数量的服务器,我的工作。