Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 如何获得调试postgres的权限?_Linux_Postgresql_Debugging_Gdb - Fatal编程技术网

Linux 如何获得调试postgres的权限?

Linux 如何获得调试postgres的权限?,linux,postgresql,debugging,gdb,Linux,Postgresql,Debugging,Gdb,我有一个在Postgres数据库中使用C方法作为函数的系统。当我尝试使用我的用户帐户运行gdb时,我得到以下结果: ptrace:不允许操作 这看起来像是许可的事情。当我以“postgres”用户的身份运行gdb时,它似乎起到了作用。我想继续以“postgres”用户的身份运行postgres,而不必在调试时su postgres。我能否以某种方式授予我的用户帐户“ptrace”对相关进程的权限?把自己加入“博士后”组似乎没有什么帮助 编辑:我在ptrace手册页上找到了: EPERM The

我有一个在Postgres数据库中使用C方法作为函数的系统。当我尝试使用我的用户帐户运行gdb时,我得到以下结果:
ptrace:不允许操作

这看起来像是许可的事情。当我以“postgres”用户的身份运行gdb时,它似乎起到了作用。我想继续以“postgres”用户的身份运行postgres,而不必在调试时
su postgres
。我能否以某种方式授予我的用户帐户“ptrace”对相关进程的权限?把自己加入“博士后”组似乎没有什么帮助

编辑:我在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). EPERM无法跟踪指定的进程。这可能是因为 父级没有足够的权限(所需的功能 是CAP_SYS_PTRACE);非根进程无法跟踪进程 他们无法向或运行set user的用户发送信号- ID/设置组ID程序,原因显而易见。或者, 该过程可能已经被跟踪,或者是init(8)(PID 1)。
那么,我如何才能将CAP\u SYS\u TRACE权限授予我的用户呢?

看来CAP\u SYS\u TRACE是由您的计算机上安装或不安装的LIDS控制的


如果您正在对postgres进行大量开发,您可能更愿意在自己的帐户下运行postgres实例-这就是我对我所使用的许多服务器所做的。

您最好在这里询问您是否尝试过以root或postgres身份运行ptrace?