From owner-freebsd-bugs@FreeBSD.ORG Thu Nov 14 18:10:03 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2729A8 for ; Thu, 14 Nov 2013 18:10:02 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C28B42172 for ; Thu, 14 Nov 2013 18:10:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id rAEIA2cb082132 for ; Thu, 14 Nov 2013 18:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id rAEIA2P2082131; Thu, 14 Nov 2013 18:10:02 GMT (envelope-from gnats) Resent-Date: Thu, 14 Nov 2013 18:10:02 GMT Resent-Message-Id: <201311141810.rAEIA2P2082131@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Patrick Proniewski Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C01BF83 for ; Thu, 14 Nov 2013 18:07:59 +0000 (UTC) Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0BBEB2116 for ; Thu, 14 Nov 2013 18:07:59 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id rAEI7wAP056977 for ; Thu, 14 Nov 2013 18:07:58 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id rAEI7w00056961; Thu, 14 Nov 2013 18:07:58 GMT (envelope-from nobody) Message-Id: <201311141807.rAEI7w00056961@oldred.freebsd.org> Date: Thu, 14 Nov 2013 18:07:58 GMT From: Patrick Proniewski To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: bin/183962: `last reboot` does not return any result X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Nov 2013 18:10:03 -0000 >Number: 183962 >Category: bin >Synopsis: `last reboot` does not return any result >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Nov 14 18:10:01 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Patrick Proniewski >Release: 9.2-RELEASE amd64 >Organization: >Environment: FreeBSD mydomain 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 UTC 2013 root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 >Description: The last(1) command has evolved between FreeBSD 8 and FreeBSD 9. On FreeBSD 8 issuing `last reboot` will list every reboot of the OS during current month (by default). This is done thanks to a virtual user named "reboot" used to register reboot actions into wtmp file. On FreeBSD 9, storage of these informations has moved from wtmp to a new file: utx. It looks like the pseudo-user "reboot" is no longer available in utx database, so issuing `last reboot` returns nothing : FreeBSD 8: --------------- $ last -f /var/log/wtmp.1 reboot reboot ~ Thu Sep 12 07:03 wtmp begins Mon Sep 2 09:53:18 CEST 2013 --------------- FreeBSD 9: --------------- $ last -f /var/log/utx.log.1 reboot wtmp begins Mon Sep 2 07:13:57 CEST 2013 --------------- Content of utx.log does not include proper reboot info, instead it lists shutdown and boot time: $ last -f /var/log/utx.log.1 | grep 'shut\|boot' boot time Thu Sep 12 06:40 shutdown time Thu Sep 12 06:40 user pts/1 192.168.0.2 Thu Sep 12 06:37 - shutdown (00:02) So: -1 man page is not up to date -2 last(1) source code is not up to date (still outputs "wtmp begins...") -3 would be great if `last reboot` could work like in FreeBSD 8. >How-To-Repeat: compare output of `last reboot` on FreeBSD 8 and FreeBSD 9. >Fix: >Release-Note: >Audit-Trail: >Unformatted: