Posted on 2010/04/28 14:54
Filed Under OS/YJJ Linux

리눅스의 last 명령에 보면 아래와 같이 나오는게 일반적인 내용이다.

root     pts/7        61.74.95.X     Thu Apr  1 17:51 - 19:56  (02:04)
root     pts/7        192.168.100.X    Thu Apr  1 17:49 - 17:51  (00:01)
root     pts/7        61.74.95.X     Thu Apr  1 13:23 - 13:33  (00:09)

그러나 logout time에 아래와 같은 기록이 남을 경우도 생긴다.

root     pts/1        :0.0             Wed Mar 31 13:45 - down   (00:08)
root     :0                            Wed Mar 31 13:45 - down   (00:08)
root     pts/0        :0.0             Wed Mar 31 13:56 - crash (20+06:08)
root     :0                            Wed Mar 31 13:55 - crash (20+06:09)
root     pts/0        61.74.95.191     Wed Apr 28 14:50   still logged in


down, crash, still 등등의 각 경우에 대한 설명이다.
내용은 last.c 의 내용을 발췌 하였다.

        switch(what) {
                case R_CRASH:
                        sprintf(logouttime, "- crash");
                        break;
                case R_DOWN:
                        sprintf(logouttime, "- down ");
                        break;
                case R_NOW:
                        length[0] = 0;
                        sprintf(logouttime, "  still");
                        sprintf(length, "logged in");
                        break;
                case R_PHANTOM:
                        length[0] = 0;
                        sprintf(logouttime, "   gone");
                        sprintf(length, "- no logout");
                        break;
                case R_REBOOT:
                        logouttime[0] = 0;      /* Print machine uptime */
                        break;
                case R_TIMECHANGE:
                        logouttime[0] = 0;
                        length[0] = 0;
                        break;
                case R_NORMAL:
                        break;


/* Types of listing */
#define R_CRASH         1 /* No logout record, system boot in between */
#define R_DOWN          2 /* System brought down in decent way */
#define R_NORMAL        3 /* Normal */
#define R_NOW           4 /* Still logged in */
#define R_REBOOT        5 /* Reboot record. */
#define R_PHANTOM       6 /* No logout record but session is stale. */
#define R_TIMECHANGE    7 /* NEW_TIME or OLD_TIME */

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2010/04/28 14:54 2010/04/28 14:54

트랙백 주소 : http://blog.seabow.pe.kr/trackback/724



About

by 삐꾸강아쥐

Counter

· Total
: 137356
· Today
: 57
· Yesterday
: 0
블로그코리아에 블UP하기