[P&AM Lab] who (BusyBox)������ � ����� /var/run/utmp
����� �����
lonely.ruyk �� mail.ru
�� ��� 23 00:49:24 MSK 2010
��� ������� ������� who �������� ������� �� ��������� utmp, �� ������� � ����� � ��� �������� ������ � ������������� � ������ ������ ���������� � �������.��� �������� ������� ���������:
int main(int argc, char *argv[])
{
struct utmp *ut;
int i=0;
setutent();
while((ut = getutent()) != NULL) {
printf("%02d UT_ID=%s ut_type=%d ",i++ ,ut->ut_id, ut->ut_type);
printf("pid=%d User-%s\n",ut->ut_pid, ut->ut_user);
}
return 0;
}
�� ������ ����������:
00 UT_ID=si ut_type=8 pid=653 User-
01 UT_ID=~~ ut_type=2 pid=0 User-reboot
02 UT_ID=~~ ut_type=1 pid=20018 User-runlevel
03 UT_ID=l2 ut_type=8 pid=1651 User-
04 UT_ID=1 ut_type=6 pid=2459 User-LOGIN
05 UT_ID=2 ut_type=6 pid=2460 User-LOGIN
06 UT_ID=ts/0ruyk ut_type=7 pid=6870 User-ruyk
07 UT_ID=ts/7ruyk ut_type=8 pid=2736 User-ruyk
������ 04-07 - ��� ���������� � ���������� ����������. � ������ ������� ������ 00-03 � ��� ��� ������?
----------- �������� ����� -----------
�������� � ������� HTML ���� ���������…
URL: <http://amplab.syktsu.ru/pipermail/lab/attachments/20101222/bd8490ce/attachment.htm>
��������� ���������� � ������ �������� Lab