Bug 14150

Summary: /usr/binlast does not accept input from stdin nor does it process .gz files
Product: Base System Reporter: pfeifer <pfeifer>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.2-RELEASE   
Hardware: Any   
OS: Any   

Description pfeifer 1999-10-06 02:10:02 UTC
/usr/binlast does not accept input from stdin nor does it process
.gz files.

So, why is this a problem? After all, there is the -f option, right?

This is not sufficient, as FreeBSD gzips the current wtmp once a
month to /var/log/wtmp.Month.gz and the -f option does not work with
.gz files.

Fix: 

1. Make /usr/bin/last accept wtmp format on stdin.
2. Enable /usr/bin/last to process .gz files.
Comment 1 Ruslan Ermilov 1999-10-06 08:20:01 UTC
On Tue, Oct 05, 1999 at 06:02:43PM -0700, pfeifer@dbai.tuwien.ac.at wrote:
> 
> /usr/bin/last does not accept input from stdin nor does it process
> .gz files.
> 
> So, why is this a problem? After all, there is the -f option, right?
> 
Right :-)

`/usr/bin/last -f /dev/stdin < wtmp-format-file' will do the trick.

As for .gz files, it's bloat.


-- 
Ruslan Ermilov		Sysadmin and DBA of the
ru@ucb.crimea.ua	United Commercial Bank,
ru@FreeBSD.org		FreeBSD committer,
+380.652.247.647	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age
Comment 2 Brian Somers freebsd_committer freebsd_triage 1999-10-06 10:44:36 UTC
State Changed
From-To: open->closed

Adding gzip capabilities to last would be considered extraneous to most. 
I'd suggest the originator removes the Z from the wtmp line in newsyslog.conf 

Comment 3 pfeifer 1999-10-06 18:38:43 UTC
On Wed, 6 Oct 1999, Ruslan Ermilov wrote:
>> So, why is this a problem? After all, there is the -f option, right?
> Right :-)
> 
> `/usr/bin/last -f /dev/stdin < wtmp-format-file' will do the trick.

Hmm, but unfortunately

  % zcat /var/log/wtmp.Aug.gz | /usr/bin/last -f /dev/stdin
  last: /dev/stdin: Illegal seek

does not work. Even with that nice trick I still do not see how I can
use last for one of those gzipped wtmp files in /var/log.

> As for .gz files, it's bloat.

Fully agreed. That why I filed the report to ask for /usr/bin/last 
also accepting its input from stdin so that I can just issue

  % zcat /var/log/wtmp.Aug.gz | last 

Sorry if my original GNATS submission did not specify this clearly enough.

Gerald
-- 
Gerald "Jerry" pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/