/proc/PID/sessionid 在 Linux 机器上意味着什么?

/proc/PID/sessionid 在 Linux 机器上意味着什么?

在 Ubuntu Linux 20.04 上,cat /proc/$$/sessionid显示3,在 openSUSE 15.5 上,显示2

3肯定2与 中的会话 ID 值(SID)有不同的含义getsid(0),那么它是什么意思呢?

Ubuntu 截图

openSUSE 截图

答案1

https://www.kernel.org/doc/Documentation/ABI/stable/procfs-audit_loginuid

What:       Audit Login Session ID
Date:       2008-03-13
KernelVersion:  2.6.25-rc7 1e0bd7550ea9 ("[PATCH] export sessionid alongside the loginuid in procfs")
Contact:    [email protected]
Users:      audit and login applications
Description:
        The /proc/$pid/sessionid pseudofile is read to get the
        audit login session ID of process $pid as a decimal
        unsigned int (%u, u32).  It is set automatically,
        serially assigned with each new login.

相关内容