[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

logs pid in utmp



Hi,

I've this bug report #89874 :

As seen below, gnome-terminal logs the pid for gnome-terminal in utmp,
rather than the pid of the user's shell, as is expected. (I.e., the PID
recorded for pts/0 should be 1128.)

> ./who -uH
NAME     LINE         TIME         IDLE          PID COMMENT  
mstone   :0           Mar 14 18:15   ?          1044          
mstone   pts/0        Mar 14 18:16 00:12        1119 (:0)     
mstone   pts/1        Mar 14 18:16   .          1119 (:0)     
mstone   pts/2        Mar 14 18:16 00:16        1119 (:0)     
mstone   pts/3        Mar 14 18:16   .          1119 (:0)     
> ps -ef | grep 1119
mstone    1119     1  0 Mar14 ?        00:00:37 gnome-terminal ...
mstone    1127  1119  0 Mar14 ?        00:00:00 gnome-pty-helper
mstone    1128  1119  0 Mar14 pts/0    00:00:00 -csh
mstone    1135  1119  0 Mar14 pts/1    00:00:01 -csh
mstone    1152  1119  0 Mar14 pts/2    00:00:00 -csh
mstone    1168  1119  0 Mar14 pts/3    00:00:00 -csh

And I see in the gnome-libs source code :

* FIXME: Do we want to register the PID of the process running *under* the subshell
* or the PID of the parent process? (we are doing the latter now).

In man 5 utmp I see :

This structure gives the name of the special file  associ­
       ated  with the user's terminal, the user's login name, and
       the time of login in the form of time(2).

My question is what is the normal way to register PID ?

Christian



Reply to: