OpenSolaris

Printable Version Enter a New Search
Bug ID 6475264
Synopsis uptime in a brandz zone shows the global zone's uptime instead of its own
State 10-Fix Delivered (Fix available in build)
Category:Subcategory kernel:brandz
Keywords brandz | localzone | uptime | zone
Responsible Engineer Russell Blaine
Reported Against
Duplicate Of
Introduced In solaris_nevada
Commit to Fix snv_70
Fixed In snv_70
Release Fixed solaris_nevada(snv_70)
Related Bugs 6774519
Submit Date 26-September-2006
Last Update Date 8-August-2007
Description
Uptime in a brandz zone shows the global zone's uptime, even if the brandz zone
  was just booted, it could show 54 days for example.

  zone1 is a normal solaris localzone, zone6 is a brandz zone:   
bash-3.00# uptime
  9:57am  up  1:10,  2 users,  load average: 0.22, 0.24, 0.26
bash-3.00#
bash-3.00# zoneadm -z zone1 boot
bash-3.00# zoneadm -z zone6 boot
bash-3.00#
bash-3.00# zlogin zone1 uptime
  9:58am  up  0 users,  load average: 1.71, 0.56, 0.37
bash-3.00# zlogin zone6 uptime
 04:58:22  up  1:11,  0 users,  load average: 1.69, 0.57, 0.37
bash-3.00#
  


  Mail extract from opensolaris thread:
http://www.opensolaris.org/jive/thread.jspa?threadID=14462&tstart=0

Subject: Re: [brandz-discuss] uptime in a brandz zone give the global zone's
        uptime ?


   
On Tue 09/26/06 at 10:02 AM,  xxxxx@xxxxx.COM wrote:
>  
>   uptime in a normal solaris localzone shows (as you'd guess) the uptime
>   of that zone.
>  
>   In a brandz though, uptime shows the uptime of the globalzone.
>  
>   This right ?
   
Hm, not really.
   
The Solaris uptime works by reading /var/adm/utmp, which is local to the
zone.  The Linux uptime works by reading /proc/uptime.  Within the kernel,
we don't track when the zone was booted, so we don't have a ready-made
value to plug into /proc/uptime.  I thought we used the birthtime of the
zone's init(1M) process as an approximation, but I don't see that in the
code right now.  I'm not sure if somebody took it out, or if I'm thinking
of some other place we played that trick.

Would you mind filing a bug on this?
  
Thanks,
  Nils
Work Around
N/A
Comments
N/A