Skip to content

Commit

Permalink
last: merge sysvinit last/lastb
Browse files Browse the repository at this point in the history
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
  • Loading branch information
Ondrej Oprala authored and karelzak committed Aug 12, 2013
1 parent 6f96420 commit ce60272
Show file tree
Hide file tree
Showing 8 changed files with 1,474 additions and 476 deletions.
2 changes: 1 addition & 1 deletion bash-completion/Makemodule.am
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ dist_bashcompletion_DATA += \
bash-completion/chfn \
bash-completion/chsh
endif
if BUILD_LAST
if BUILD_DEPRECATED_LAST
dist_bashcompletion_DATA += \
bash-completion/last
endif
Expand Down
14 changes: 11 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,6 @@ AC_ARG_ENABLE([most-builds],
AS_IF([test "x$enable_most_builds" = xyes], [
enable_chfn_chsh=yes
enable_elvtune=check
enable_last=yes
enable_line=yes
enable_mesg=yes
enable_newgrp=yes
Expand Down Expand Up @@ -1062,9 +1061,18 @@ UL_REQUIRES_LINUX([kill])
AM_CONDITIONAL([BUILD_KILL], [test "x$build_kill" = xyes])


AC_ARG_ENABLE([deprecated-last],
AS_HELP_STRING([--enable-deprecated-last], [build old deprecated last]),
[], [enable_deprecated_last=no]
)
UL_BUILD_INIT([deprecated_last])
UL_CONFLICTS_BUILD([last], [deprecated_last], [old deprecated last version])
AM_CONDITIONAL([BUILD_DEPRECATED_LAST], [test "x$build_deprecated_last" = xyes])


AC_ARG_ENABLE([last],
AS_HELP_STRING([--enable-last], [build last]),
[], [enable_last=no]
AS_HELP_STRING([--disable-last], [do not build last]),
[], [enable_last=yes]
)
UL_BUILD_INIT([last])
AM_CONDITIONAL([BUILD_LAST], [test "x$build_last" = xyes])
Expand Down
16 changes: 15 additions & 1 deletion login-utils/Makemodule.am
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@

if BUILD_LAST
usrbin_exec_PROGRAMS += last
dist_man_MANS += login-utils/last.1
dist_man_MANS +=
login-utils/last.1 \
login-utils/lastb.1
last_SOURCES = login-utils/last.c

install-exec-hook-last:
cd $(DESTDIR)$(usrsbin_execdir) && ln -sf last lastb

INSTALL_EXEC_HOOKS += install-exec-hook-last
endif

if BUILD_DEPRECATED_LAST

usrbin_exec_PROGRAMS += last
dist_man_MANS += login-utils/last-deprecated.1
last_SOURCES = login-utils/last-deprecated.c

endif # BUILD_DEPRECATED_LAST

if BUILD_SULOGIN
sbin_PROGRAMS += sulogin
Expand Down
62 changes: 62 additions & 0 deletions login-utils/last-deprecated.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.TH LAST 1 "March 1992" "util-linux" "User Commands"
.SH NAME
last \(em indicate last logins by user or terminal
.SH SYNOPSIS
.ad l
.B last
.RB [ \-\fP\fInumber\fP ]
.RB [ \-f
.IR filename ]
.RB [ \-t
.IR tty ]
.RB [ \-h
.IR hostname ]
.RB [ \-i
.IR address ]
.RB [ \-l ]
.RB [ \-y ]
.RI [ name ...]
.ad b
.SH DESCRIPTION
\fBLast\fP looks back in the \fBwtmp\fP file which records all logins
and logouts for information about a user, a teletype or any group of
users and teletypes. Arguments specify names of users or teletypes of
interest. If multiple arguments are given, the information which
applies to any of the arguments is printed. For example ``\fBlast root
console\fP'' would list all of root's sessions as well as all sessions
on the console terminal. \fBLast\fP displays the sessions of the
specified users and teletypes, most recent first, indicating the times
at which the session began, the duration of the session, and the
teletype which the session took place on. If the session is still
continuing or was cut short by a reboot, \fBlast\fP so indicates.
.LP
The pseudo-user \fBreboot\fP logs in at reboots of the system.
.LP
\fBLast\fP with no arguments displays a record of all logins and
logouts, in reverse order.
.LP
If \fBlast\fP is interrupted, it indicates how far the search has
progressed in \fBwtmp\fP. If interrupted with a quit signal \fBlast\fP
indicates how far the search has progressed so far, and the search
continues.
.SH OPTIONS
.IP \fB\-\fP\fInumber\fP
limit the number of entries displayed to that specified by \fInumber\fP.
.IP "\fB\-f\fP \fIfilename\fP"
Use \fIfilename\fP as the name of the accounting file instead of
.BR /var/log/wtmp .
.IP "\fB\-h\fP \fIhostname\fP"
List only logins from \fIhostname\fP.
.IP "\fB\-i\fP \fIIP address\fP"
List only logins from \fIIP address\fP.
.IP "\fB\-l\fP"
List IP addresses of remote hosts instead of truncated host names.
.IP "\fB\-t\fP \fItty\fP"
List only logins on \fItty\fP.
.IP "\fB\-y\fP"
Also report year of dates.
.SH FILES
/var/log/wtmp \(em login data base
.SH AVAILABILITY
The last command is part of the util-linux package and is available from
ftp://ftp.kernel.org/pub/linux/utils/util-linux/.

0 comments on commit ce60272

Please sign in to comment.