23b762648a
Submitted by: Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp> Approved by: kuriyama (mentor/implicitly)
257 lines
6 KiB
Groff
257 lines
6 KiB
Groff
.\" Copyright (c) 1980, 1991, 1993
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
.\"
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
.\" modification, are permitted provided that the following conditions
|
|
.\" are met:
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
.\" must display the following acknowledgement:
|
|
.\" This product includes software developed by the University of
|
|
.\" California, Berkeley and its contributors.
|
|
.\" 4. Neither the name of the University nor the names of its contributors
|
|
.\" may be used to endorse or promote products derived from this software
|
|
.\" without specific prior written permission.
|
|
.\"
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
.\" SUCH DAMAGE.
|
|
.\"
|
|
.\" @(#)utmp.5 8.2 (Berkeley) 3/17/94
|
|
.\" %FreeBSD: src/share/man/man5/utmp.5,v 1.21 2003/09/08 19:57:20 ru Exp %
|
|
.\"
|
|
.\" $FreeBSD$
|
|
.Dd November 14, 2001
|
|
.Dt UTMP 5
|
|
.Os
|
|
.Sh ̾¾Î
|
|
.Nm utmp ,
|
|
.Nm wtmp ,
|
|
.Nm lastlog
|
|
.Nd ¥í¥°¥¤¥óµÏ¿
|
|
.Sh ½ñ¼°
|
|
.In sys/types.h
|
|
.In utmp.h
|
|
.Sh ²òÀâ
|
|
.In utmp.h
|
|
¥Õ¥¡¥¤¥ë¤Ï¡¢
|
|
.Nm
|
|
¥Õ¥¡¥¤¥ë¤Ç¤Î¸½ºß¤Î¥æ¡¼¥¶¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ä
|
|
.Nm wtmp
|
|
¥Õ¥¡¥¤¥ëÃæ¤Ç¤Î¥í¥°¥¤¥ó¤ä¥í¥°¥¢¥¦¥È¤Î¾ðÊó¡¢
|
|
.Nm lastlog
|
|
¥Õ¥¡¥¤¥ëÃæ¤Ç¤ÎºÇ½ª¥í¥°¥¤¥ó¾ðÊó¤ÎµÏ¿¤Î¤¿¤á¤Ë»È¤ï¤ì¤ë¹½Â¤ÂΤò
|
|
Àë¸À¤·¤Æ¤¤¤Þ¤¹¡£
|
|
»þ¹ï¤ÎÊѹ¹¤ä¥·¥ã¥Ã¥È¥À¥¦¥ó¤ª¤è¤Ó¥ê¥Ö¡¼¥È¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤Ï¡¢Æ±¤¸¤è¤¦¤Ë
|
|
.Nm wtmp
|
|
¥Õ¥¡¥¤¥ë¤ËµÏ¿¤µ¤ì¤Þ¤¹¡£
|
|
.Bd -literal -offset indent
|
|
#define _PATH_UTMP "/var/run/utmp"
|
|
#define _PATH_WTMP "/var/log/wtmp"
|
|
#define _PATH_LASTLOG "/var/log/lastlog"
|
|
|
|
#define UT_NAMESIZE 16
|
|
#define UT_LINESIZE 8
|
|
#define UT_HOSTSIZE 16
|
|
|
|
struct lastlog {
|
|
int32_t ll_time; /* ¥æ¡¼¥¶¤¬²¿»þ¥í¥°¥¤¥ó¤·¤¿¤« */
|
|
char ll_line[UT_LINESIZE]; /* üËöÀþ̾ */
|
|
char ll_host[UT_HOSTSIZE]; /* ¥æ¡¼¥¶¤Î½Ð¿È¥Û¥¹¥È */
|
|
};
|
|
|
|
struct utmp {
|
|
char ut_line[UT_LINESIZE]; /* üËöÀþ̾ */
|
|
char ut_name[UT_NAMESIZE]; /* ¥æ¡¼¥¶¤Î¥í¥°¥¤¥ó̾ */
|
|
char ut_host[UT_HOSTSIZE]; /* ¥æ¡¼¥¶¤Î½Ð¿È¥Û¥¹¥È */
|
|
int32_t ut_time; /* ¥æ¡¼¥¶¤¬²¿»þ¥í¥°¥¤¥ó¤·¤¿¤« */
|
|
};
|
|
.Ed
|
|
.Pp
|
|
.Nm lastlog
|
|
¥Õ¥¡¥¤¥ë¤Ï¡¢
|
|
.Vt lastlog
|
|
¹½Â¤ÂΤÎÀþ·¿ÇÛÎó¤Ç¤¢¤ê¡¢¥æ¡¼¥¶¤Î
|
|
.Tn UID
|
|
¤Ç¥¤¥ó¥Ç¥Ã¥¯¥¹¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
|
|
.Nm
|
|
¥Õ¥¡¥¤¥ë¤Ï¡¢
|
|
.Vt utmp
|
|
¹½Â¤ÂΤÎÀþ·¿ÇÛÎó¤Ç¤¢¤ê¡¢Ã¼ËöÀþÈÖ¹æ (
|
|
.Xr ttyslot 3
|
|
»²¾È) ¤Ç¥¤¥ó¥Ç¥Ã¥¯¥¹¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
|
|
.Nm wtmp
|
|
¥Õ¥¡¥¤¥ë¤Ï¡¢
|
|
.Vt utmp
|
|
¹½Â¤ÂΤ«¤éÀ®¤ë¥Ð¥¤¥Ê¥ê¥í¥°¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¡¢
|
|
¥Õ¥¡¥¤¥ë¤Î½ªÃ¼¤ËÄɵ¤µ¤ì¤Æ¤¤¤¤Þ¤¹¡£
|
|
.Pp
|
|
¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥æ¡¼¥¶¤¬¥í¥°¥¤¥ó¤¹¤ë¤¿¤Ó¤Ë¡¢
|
|
.Xr pam_lastlog 8
|
|
¥×¥í¥°¥é¥à¤Ï
|
|
.Nm lastlog
|
|
¥Õ¥¡¥¤¥ëÃæ¤Î¥æ¡¼¥¶¤Î
|
|
.Tn UID
|
|
¤ò¸¡º÷¤·¤Þ¤¹¡£
|
|
¤â¤·¸«¤Ä¤«¤Ã¤¿¾ì¹ç¡¢¥æ¡¼¥¶¤¬ºÇ¸å¤Ë¥í¥°¥¤¥ó¤·¤¿»þ¹ï¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¡¢
|
|
üËöÀþ¡¢¥Û¥¹¥È̾¤¬É¸½à½ÐÎϤ˽ñ¤½Ð¤µ¤ì¤Þ¤¹¡£
|
|
.Xr pam_lastlog 8
|
|
¥×¥í¥°¥é¥à¤Ï¡¢¤½¤Î¸å
|
|
.Nm lastlog
|
|
¥Õ¥¡¥¤¥ë¤Ë¿·¤·¤¤¥í¥°¥¤¥ó»þ¹ï¤òµÏ¿¤·¤Þ¤¹¡£
|
|
.Pp
|
|
¿·¤·¤¤
|
|
.Vt lastlog
|
|
¤Ø¤ÎµÏ¿¤¬½ñ¤½Ð¤µ¤ì¤¿¸å¤Ç¡¢
|
|
.\" the
|
|
.\" .Xr libutil 3
|
|
.\" routine
|
|
.Nm
|
|
¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤µ¤ì¡¢¥æ¡¼¥¶¤ËÂФ¹¤ë
|
|
.Vt utmp
|
|
µÏ¿¤¬ÁÞÆþ¤µ¤ì¤Þ¤¹¡£
|
|
¤³¤ÎµÏ¿¤Ï¡¢¥æ¡¼¥¶¤¬¥í¥°¥¢¥¦¥È¤·¤Æºï½ü¤µ¤ì¤ë»þ¤Þ¤ÇÊÝ»ý¤µ¤ì¤Þ¤¹¡£
|
|
.Nm
|
|
¥Õ¥¡¥¤¥ë¤Ï¡¢
|
|
.Xr rwho 1 ,
|
|
.Xr users 1 ,
|
|
.Xr w 1 ,
|
|
.Xr who 1
|
|
¥×¥í¥°¥é¥à¤Ç»È¤ï¤ì¤Þ¤¹¡£
|
|
.Pp
|
|
¼¡¤Ë¡¢
|
|
.Xr pam_lastlog 8
|
|
¥×¥í¥°¥é¥à¤Ï
|
|
.Nm wtmp
|
|
¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¡¢¥æ¡¼¥¶¤Î
|
|
.Vt utmp
|
|
µÏ¿¤òÄɲä·¤Þ¤¹¡£
|
|
¤½¤Î¸å¥æ¡¼¥¶¤¬Ã¼ËöÀþ¤«¤é¥í¥°¥¢¥¦¥È¤¹¤ë¤È¡¢ÆÃÊ̤Ê
|
|
.Vt utmp
|
|
¥ì¥³¡¼¥É¤¬µÏ¿¤µ¤ì¤Þ¤¹¡£
|
|
¤¹¤Ê¤ï¤Á
|
|
.Va ut_line
|
|
¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¡¢
|
|
.Va ut_time
|
|
¤¬¹¹¿·¤µ¤ì¤Þ¤¹¤¬¡¢
|
|
.Va ut_name
|
|
¤È
|
|
.Va ut_host
|
|
¤Ï¶õ¤Ç¤¢¤ë¤â¤Î¤¬µÏ¿¤µ¤ì¤Þ¤¹ (
|
|
.Xr init 8
|
|
»²¾È)¡£
|
|
.Nm wtmp
|
|
¥Õ¥¡¥¤¥ë¤Ï¡¢
|
|
.Xr last 1
|
|
¤È
|
|
.Xr ac 8
|
|
¥×¥í¥°¥é¥à¤Ç»È¤ï¤ì¤Þ¤¹¡£
|
|
.Pp
|
|
»þ¹ïÊѹ¹¤ä¥·¥ã¥Ã¥È¥À¥¦¥ó¡¦¥ê¥Ö¡¼¥È¤ÎºÝ¤Ë¤Ï¡¢
|
|
°Ê²¼¤Î¹àÌܤ¬
|
|
.Nm wtmp
|
|
¥Õ¥¡¥¤¥ë¤ËµÏ¿¤µ¤ì¤Þ¤¹¡£
|
|
.Pp
|
|
.Bl -tag -width ".Li shutdown" -compact
|
|
.It Li reboot
|
|
.It Li shutdown
|
|
¥·¥¹¥Æ¥à¤Î¥ê¥Ö¡¼¥È¤ä¥·¥ã¥Ã¥È¥À¥¦¥ó¤¬³«»Ï¤µ¤ì¤¿¡£
|
|
.Va ut_line
|
|
¥Õ¥£¡¼¥ë¥É¤Ë
|
|
.Ql \&~
|
|
¤È¸À¤¦Ê¸»ú¤¬¡¢
|
|
.Va ut_name
|
|
¥Õ¥£¡¼¥ë¥ÉÃæ¤Ë
|
|
.Li reboot
|
|
¤â¤·¤¯¤Ï
|
|
.Li shutdown
|
|
¤¬µÏ¿¤µ¤ì¤Þ¤¹ (
|
|
.Xr shutdown 8
|
|
¤È
|
|
.Xr reboot 8
|
|
»²¾È)¡£
|
|
.Pp
|
|
.It Li date
|
|
¥·¥¹¥Æ¥à»þ¹ï¤¬¼êÆ°¤â¤·¤¯¤Ï¼«Æ°¤Ç¹¹¿·¤µ¤ì¤¿ (
|
|
.Xr date 1
|
|
»²¾È)¡£
|
|
¥³¥Þ¥ó¥É̾
|
|
.Li date
|
|
¤¬¥Õ¥£¡¼¥ë¥É
|
|
.Va ut_name
|
|
¤ËµÏ¿¤µ¤ì¤Þ¤¹¡£
|
|
.Fa ut_line
|
|
¥Õ¥£¡¼¥ë¥ÉÃæ¤Î
|
|
.Ql \&|
|
|
ʸ»ú¤Ï¡¢Êѹ¹Á°¤Î»þ¹ï¤ò¼¨¤·¡¢
|
|
.Ql \&{
|
|
ʸ»ú¤Ï¿·¤·¤¤»þ¹ï¤ò¼¨¤·¤Æ¤¤¤Þ¤¹¡£
|
|
.El
|
|
.Sh Ãí
|
|
.Nm wtmp
|
|
¥Õ¥¡¥¤¥ë¤Ï¡¢Ë»¤·¤¤¥·¥¹¥Æ¥à¤Ç¤ÏµÞ®¤ËÂ礤¯¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¢
|
|
ËèÆü¤â¤·¤¯¤ÏËè½µ¥í¡¼¥Æ¡¼¥·¥ç¥ó¤¹¤ë¤³¤È¤ò¿ä¾©¤·¤Þ¤¹¡£
|
|
¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢
|
|
.Xr newsyslog 8
|
|
¤Ë¤è¤Ã¤Æ´ÉÍý¤µ¤ì¤Þ¤¹¡£
|
|
.Pp
|
|
¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢
|
|
.Xr pam_lastlog 8
|
|
¤Ï¤³¤ì¤é¤òºîÀ®¤·¤Þ¤»¤ó¡£
|
|
¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¼êÆ°¤ÇºîÀ®¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
|
|
.Pp
|
|
.Nm
|
|
¤ª¤è¤Ó
|
|
.Nm wtmp
|
|
¤Î¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ëÄ̾ï¤ÎÁàºî¤Ï¡¢Ä󶡤µ¤ì¤¿
|
|
.Xr login 3 ,
|
|
.Xr logout 3 ,
|
|
.Xr logwtmp 3
|
|
¥æ¡¼¥Æ¥£¥ê¥Æ¥£´Ø¿ô¤Ç¹Ô¤¤¡¢
|
|
¤³¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Î½ñ¼°¤¬°Û¤Ê¤ë¥·¥¹¥Æ¥à´Ö¤Ç¤Î¸ß´¹À¤ò°Ý»ý¤¹¤Ù¤¤Ç¤¹¡£
|
|
.Sh ´ØÏ¢¥Õ¥¡¥¤¥ë
|
|
.Bl -tag -width ".Pa /var/log/lastlog" -compact
|
|
.It Pa /var/run/utmp
|
|
.Nm
|
|
¥Õ¥¡¥¤¥ë¡£
|
|
.It Pa /var/log/wtmp
|
|
.Nm wtmp
|
|
¥Õ¥¡¥¤¥ë¡£
|
|
.It Pa /var/log/lastlog
|
|
.Nm lastlog
|
|
¥Õ¥¡¥¤¥ë¡£
|
|
.El
|
|
.Sh ´ØÏ¢¹àÌÜ
|
|
.Xr last 1 ,
|
|
.Xr w 1 ,
|
|
.Xr who 1 ,
|
|
.Xr login 3 ,
|
|
.Xr logout 3 ,
|
|
.Xr logwtmp 3 ,
|
|
.Xr ttyslot 3 ,
|
|
.Xr ac 8 ,
|
|
.Xr init 8 ,
|
|
.Xr pam_lastlog 8
|
|
.Sh Îò»Ë
|
|
.Nm
|
|
¤È
|
|
.Nm wtmp
|
|
¥Õ¥¡¥¤¥ë½ñ¼°¤Ï
|
|
.At v6
|
|
¤«¤éÅо줷¤Þ¤·¤¿¡£
|
|
.Nm lastlog
|
|
¥Õ¥¡¥¤¥ë½ñ¼°¤Ï
|
|
.Bx 3.0
|
|
¤«¤éÅо줷¤Þ¤·¤¿¡£
|