[Pkg-sysvinit-devel] Bug#58119: last -x shortcomings

Thomas Hood jdthood at yahoo.co.uk
Tue Jan 24 17:23:30 UTC 2006


tags 58119 confirmed
severity 58119 minor
stop

Thanks for the report (almost five years ago now).

You wrote:
> Whereas all entries, except reboot, give a starting and ending time,


(Yes. the "reboot" time is the time (point) of the reboot.  There is
no second time given, but the time in parentheses is the interval
between the reboot and the current time.  This number stops getting
updated on shutdown and so old reboot entries show the interval
between reboot and shutdown, i.e., uptime.  Note, however, that
system crashes don't count as shutdowns!)


> the shutdown entry gives starting times of the current and previous
> shutdown.


No, it gives the time of the previous shutdown and the current time.
The number in parentheses is the interval between them.  The current-time
field stops getting updated on shutdown, and so old shutdown entries show
the interval between shutdowns (where, again, crashes don't count as
shutdowns).


> At least that's what I've concluded after a few weeks of
> observation.  What threw me of most was the time difference that is
> included in parentheses.
> 
> I think it would be more in line with the other entries to give the
> starting and ending time of the shutdown.


I.e., instead of the shutdown-to-shutdown time it would have the
shutdown-to-reboot time.  Sounds reasonable.  I'd even call the current
behavior buggy.


> Additionally, you could perhaps add the shutdown time as the ending 
> time of the reboot entry.  That way, you can see immediately how long
> your machine has been up and down at any given time of the month.


The number in parentheses after "reboot" is the uptime.  It would be
reasonable to fill in the second value.

I just did "last -x" to a file, rebooted, did "last -x" again and then
diffed the two.  Here is the result, reflecting the following events:

    Jan 22 10:22    boot
    Jan 23 00:33    halt
    Jan 23 09:05    boot
    Jan 23 16:30ish crash
    Jan 23 16:41    boot
    Jan 24 17:27    first "last -x"
    Jan 24 17:28    halt
    Jan 24 18:02    second "last -x"

and I have rearranged the lines to put "+" lines before "-" lines rather
than after, since this makes things easier to read.

+jdthood  pts/2        :0.0             Tue Jan 24 17:34   still logged in <- login after reboot
+jdthood  pts/1        :0.0             Tue Jan 24 17:34   still logged in <- login after reboot
+jdthood  pts/0        :0.0             Tue Jan 24 17:34   still logged in <- login after reboot
+jdthood  :0                            Tue Jan 24 17:33   still logged in <- login after reboot
+runlevel (to lvl 3)   2.6.15-9-686     Tue Jan 24 17:33 - 18:02  (00:29)  <- manual runlevel change after reboot
+jdthood  tty1                          Tue Jan 24 17:30   still logged in <- login after reboot
+runlevel (to lvl 2)   2.6.15-9-686     Tue Jan 24 17:29 - 17:33  (00:03)  <- reboot after first "last -x"
+reboot   system boot  2.6.15-9-686     Tue Jan 24 17:29          (00:32)  <- reboot after first "last -x"
+shutdown system down  2.6.15-9-686     Tue Jan 24 17:28 - 18:02  (00:33)  <- halt after first "last -x"
+runlevel (to lvl 6)   2.6.15-9-686     Tue Jan 24 17:28 - 17:28  (00:00)  <- halt after first "last -x"
+jdthood  pts/0        :0.0             Tue Jan 24 12:51 - 17:28  (04:36)  <- Updated after first "last -x"
-jdthood  pts/0        :0.0             Tue Jan 24 12:51   still logged in
 jdthood  pts/1        :0.0             Tue Jan 24 11:29 - 11:51  (00:21)
 jdthood  pts/2        :0.0             Tue Jan 24 10:12 - 10:19  (00:07)
 jdthood  pts/3        :0.0             Mon Jan 23 17:56 - 09:56  (15:59)
 jdthood  pts/1        :0.0             Mon Jan 23 17:56 - 10:58  (17:02)
 jdthood  pts/2        :0.0             Mon Jan 23 17:18 - 09:57  (16:38)
 jdthood  pts/0        :0.0             Mon Jan 23 17:08 - 12:51  (19:43)
 jdthood  pts/0        :0.0             Mon Jan 23 16:52 - 17:00  (00:08)
 jdthood  pts/0        :0.0             Mon Jan 23 16:46 - 16:46  (00:00)
 jdthood  pts/1        :0.0             Mon Jan 23 16:43 - 17:24  (00:41)
 jdthood  pts/0        :0.0             Mon Jan 23 16:42 - 16:45  (00:02)
+jdthood  :0                            Mon Jan 23 16:42 - 17:28 (1+00:46)  <- Updated after first "last -x"
+runlevel (to lvl 3)   2.6.15-9-686     Mon Jan 23 16:41 - 17:28 (1+00:46)  <- Updated after first "last -x"
+jdthood  tty1                          Mon Jan 23 16:41 - down  (1+00:46)  <- Updated after first "last -x"
-jdthood  :0                            Mon Jan 23 16:42   still logged in
-runlevel (to lvl 3)   2.6.15-9-686     Mon Jan 23 16:41 - 17:27 (1+00:45)
-jdthood  tty1                          Mon Jan 23 16:41   still logged in
 runlevel (to lvl 2)   2.6.15-9-686     Mon Jan 23 16:41 - 16:41  (00:00)
+reboot   system boot  2.6.15-9-686     Mon Jan 23 16:41         (1+00:47)  <- Updated after first "last -x"
-reboot   system boot  2.6.15-9-686     Mon Jan 23 16:41         (1+00:46)
 jdthood  pts/1        :0.0             Mon Jan 23 16:23 - crash  (00:17)
 jdthood  pts/1        :0.0             Mon Jan 23 16:23 - 16:23  (00:00)
 jdthood  pts/1        :0.0             Mon Jan 23 11:39 - 12:33  (00:54)
 jdthood  pts/0        :0.0             Mon Jan 23 09:34 - crash  (07:06)
 jdthood  :0                            Mon Jan 23 09:12 - crash  (07:29)
 runlevel (to lvl 3)   2.6.15-9-686     Mon Jan 23 09:11 - 16:41  (07:29)
 jdthood  tty1                          Mon Jan 23 09:11 - 16:40  (07:28)
 runlevel (to lvl 2)   2.6.15-9-686     Mon Jan 23 09:05 - 09:11  (00:06)
 reboot   system boot  2.6.15-9-686     Mon Jan 23 09:05         (1+08:22)  <- I'm not sure why this didn't change
+shutdown system down  2.6.15-9-686     Mon Jan 23 00:33 - 17:28 (1+16:55)  <- Updated after first "last -x"
-shutdown system down  2.6.15-9-686     Mon Jan 23 00:33 - 17:27 (1+16:54)
 runlevel (to lvl 0)   2.6.15-9-686     Mon Jan 23 00:32 - 00:33  (00:00)
 jdthood  pts/1        :0.0             Sun Jan 22 20:39 - 20:42  (00:03)
 jdthood  pts/1        :0.0             Sun Jan 22 19:33 - 19:46  (00:12)
 jdthood  pts/0        :0.0             Sun Jan 22 19:19 - 00:32  (05:13)
 jdthood  pts/0        :0.0             Sun Jan 22 12:24 - 18:24  (06:00)
 jdthood  pts/1        :0.0             Sun Jan 22 11:52 - 11:57  (00:04)
 jdthood  pts/0        :0.0             Sun Jan 22 11:43 - 12:05  (00:21)
 jdthood  pts/1        :0.0             Sun Jan 22 11:08 - 11:23  (00:14)
 jdthood  pts/1        :0.0             Sun Jan 22 10:41 - 11:07  (00:26)
 jdthood  pts/0        :0.0             Sun Jan 22 10:31 - 11:23  (00:51)

-- 
Thomas Hood




More information about the Pkg-sysvinit-devel mailing list