I attached a text file that shows on how to recover / re-set a lost uptime 
span in the last record manually by editing records file. Attached due to 
word wrap in mails.

I will resync the whole issue. I might be testing with fsync() everywhere, 
cause I want to fix that truncated file issue *at the cause*. When it then 
still does not work as expected, I at least now, that the file is truncated 
even due to use of fsync() and can then file a linux kernel bug report.

-- 
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7
shambhala:/var/spool/uptimed> uprecords -m 50 | grep May                        
                          
    14     4 days, 20:45:40 | Linux 2.6.38.5-tp42-snap  Wed May  4 16:33:14 2011
my record that uptimed / Ext4 / linux kernel lost:
    23     1 day , 04:02:01 | Linux 2.6.38.5-tp42-snap  Mon May  9 18:08:32 2011
    36     0 days, 03:57:37 | Linux 2.6.38.5-tp42-snap  Mon May  9 13:20:27 2011
    38     0 days, 02:38:11 | Linux 2.6.38.5-tp42-snap  Wed May  4 13:54:29 2011
    40     0 days, 00:48:42 | Linux 2.6.38.5-tp42-snap  Mon May  9 17:18:49 2011
->  41     0 days, 00:39:29 | Linux 2.6.38.5-tp42-snap  Wed May 11 20:20:13 2011
1up in     0 days, 00:09:14 | at                        Wed May 11 21:08:54 2011
t10 in     5 days, 22:52:52 | at                        Tue May 17 19:52:32 2011
no1 in    18 days, 10:21:16 | at                        Mon May 30 07:20:56 2011

Crash was about 10 minutes before booting the new kernel (record 41).
I added some safety margin.

shambhala:/var/spool/uptimed> head -23 records | tail -1                        
           
100921:1304957312:Linux 2.6.38.5-tp42-snap-debug+resv-size-dirty
shambhala:/var/spool/uptimed> cp -p records 
records-2011-05-11-restored-from-backup
shambhala:/var/spool/uptimed> date -d "Mon May  9 18:08:32 2011 + 2 day + 1 
hour + 55 minutes"    
Mi 11. Mai 20:03:32 CEST 2011
shambhala:/var/spool/uptimed> irb                                               
                  
irb(main):001:0> 1 * 24 * 3600 + 4 * 3600 + 2 * 60 + 1
=> 100921
irb(main):002:0> 2 * 24 * 3600 + 3600 + 55 * 60
=> 179700
irb(main):003:0> #                                                              
                                    shambhala:/var/spool/uptimed> vim records
shambhala:/var/spool/uptimed> uprecords -m 50 | grep May                        
                  
    14     4 days, 20:45:40 | Linux 2.6.38.5-tp42-snap  Wed May  4 16:33:14 2011
    19     2 days, 01:55:00 | Linux 2.6.38.5-tp42-snap  Mon May  9 18:08:32 2011
    36     0 days, 03:57:37 | Linux 2.6.38.5-tp42-snap  Mon May  9 13:20:27 2011
    38     0 days, 02:38:11 | Linux 2.6.38.5-tp42-snap  Wed May  4 13:54:29 2011
    40     0 days, 00:48:42 | Linux 2.6.38.5-tp42-snap  Mon May  9 17:18:49 2011
->  41     0 days, 00:42:34 | Linux 2.6.38.5-tp42-snap  Wed May 11 20:20:13 2011
1up in     0 days, 00:06:09 | at                        Wed May 11 21:08:54 2011
t10 in     5 days, 22:49:47 | at                        Tue May 17 19:52:32 2011
no1 in    18 days, 10:18:11 | at                        Mon May 30 07:20:56 2011
shambhala:/var/spool/uptimed> uprecords                 
     #               Uptime | System                                     Boot up
----------------------------+---------------------------------------------------
     1    18 days, 11:00:44 | Linux 2.6.37-tp42-rtime-  Thu Jan 13 12:44:10 2011
     2    13 days, 20:58:39 | Linux 2.6.37-rc8-tp42     Thu Dec 30 15:44:49 2010
     3    12 days, 00:05:29 | Linux 2.6.37-tp42-rtime-  Mon Jan 31 23:50:51 2011
     4     9 days, 17:09:09 | Linux 2.6.37-tp42-rtime-  Sat Feb 12 23:57:46 2011
     5     8 days, 20:53:21 | Linux 2.6.38.3-tp42-snap  Mon Apr 18 21:51:20 2011
     6     8 days, 15:40:00 | Linux 2.6.37-tp42-rtime-  Tue Feb 22 21:18:33 2011
     7     7 days, 20:04:48 | Linux 2.6.38-tp42-snapsh  Thu Mar 17 23:47:49 2011
     8     7 days, 08:19:50 | Linux 2.6.37-rc7-tp42-at  Wed Dec 22 13:02:13 2010
     9     6 days, 13:27:02 | Linux 2.6.38-rc7-tp42-sn  Tue Mar  8 10:23:57 2011
    10     5 days, 23:32:20 | Linux 2.6.38.2-tp42-snap  Tue Mar 29 22:18:29 2011
----------------------------+---------------------------------------------------
->  41     0 days, 00:42:44 | Linux 2.6.38.5-tp42-snap  Wed May 11 20:20:13 2011
----------------------------+---------------------------------------------------
1up in     0 days, 00:05:59 | at                        Wed May 11 21:08:54 2011
t10 in     5 days, 22:49:37 | at                        Tue May 17 19:52:32 2011
no1 in    18 days, 10:18:01 | at                        Mon May 30 07:20:56 2011
    up   150 days, 06:29:06 | since                     Sat Dec 11 13:27:01 2010
  down     1 day , 00:06:50 | since                     Sat Dec 11 13:27:01 2010
   %up               99.336 | since                     Sat Dec 11 13:27:01 2010
shambhala:/var/spool/uptimed>

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to