LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   who is logged in? (Debian wheezy, current) (https://www.linuxquestions.org/questions/debian-26/who-is-logged-in-debian-wheezy-current-932251/)

widget 03-14-2012 01:22 PM

Finally got around to installing Debian Squeeze with out a login manager. Netinstall. OpenBox for the DE.

Log in and then run "who".

Logged in at tty1.

Don't have the out put on this drive or install but it is the same as what you are getting. Beats me.

Doesn't seem to effect the way anything works.

kaz2100 03-14-2012 08:06 PM

Hya,

Thanks, it looks like that squeeze works fine.
So, I need to figure out where in wheezy is responsible for failing to detect user(s) on ttyX.

My guess is:
who (coreutil package) is NOT. (reason, same version sometimes works, sometimes NOT)
kernel (custom compiled) is NOT. (reason, same as who)
consolekit may be, but probably NOT, because who works without consolekit.

Currently,
I am trying to decipher /var/run/utmp file.

cheers

kaz2100 03-28-2012 08:39 PM

Hya,

I am still having trouble. I do not have any experience with utmp. I am following variables by debugger, program is as simple as it could be.
Code:

#include <stdio.h>
#include <utmp.h>

int main(int argc, char **argv){

struct utmp        *rut;
struct utmp        ut;

setutent();
rut = getutent();
ut.ut_type = USER_PROCESS;

rut = getutid(&ut);

return 0;

}

Can anybody direct me where next step is?

cheers

kaz2100 04-23-2012 09:53 PM

Hya,

After long interval, still not solved.

Key part of ource code of who (from coreutils) looks like
Code:

who (const char *filename, int options)
{
  size_t n_users;
  STRUCT_UTMP *utmp_buf;

  if (read_utmp (filename, &n_users, &utmp_buf, options) != 0)
    error (EXIT_FAILURE, errno, "%s", filename);

  if (short_list)
    list_entries_who (n_users, utmp_buf);
  else
    scan_entries (n_users, utmp_buf);

  free (utmp_buf);
}

and
Code:

#  define GET_UTMP_ENT getutxent
I guess a little bit more to go.

kaz2100 07-04-2012 07:42 PM

Hya

Self reply.

After a long interval, I checked this issue again.
Code:

>who
penguin  tty2        2012-07-05 07:24
penguin  pts/1        2012-07-05 07:24 (:0)
penguin  pts/0        2012-07-05 07:24 (:0)
>

Two xterm's are open, after console login. So, I guess it is good now.

Have a Happy Penguin!


All times are GMT -5. The time now is 09:44 AM.