4

Supose that a linux server, at startup, report the following btime:

boot btime -> 1493875000

This server is virtualized inside a busy box and the I/O load is high, in spite of have ntp running, a month ago the report change:

last btime -> 1493875100

The system suffer a drift of "100" seconds. If the uptime is "2592000" seconds, what is the right btime? what of the following options is the right time?

1. boot btime + uptime
   1493875000 + 2592000 = 1496467000

2. boot btime + uptime + drift
   1493875000 + 2592000 + 100 = 1496467100

3. boot btime + uptime - drift
   1493875000 + 2592000 - 100 = 1496466900

4. last btime + uptime
   1493875100 + 2592000 = 1496467100

5. last btime + uptime + drift
   1493875100 + 2592000 + 100 = 1496467200

6. last btime + uptime - drift
   1493875100 + 2592000 - 100 = 1496467000
  • Where is btime coming from? – Michael Mol May 11 '17 at 18:29
  • Form /proc/stat – Rfraile May 12 '17 at 8:04
  • 1
    because boot btime + drift = last btime, i would assume options 2 or 4 properly give the answer to the question "when did this system shut down?", at least relative to that VM's concept of time. there's no guarantee that 1s in that VM is anything like 1s as measured by an external source. – quixotic May 16 '17 at 3:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.