Dear Dan,
As a workaround you may use the following perl script written by Ullrich
Horlacher. It also demonstrates the basic idea where to get a containers uptime
from. Here he use a well known file, but I think one may also use the
information related to the containers init process.
lxc-uptime:
#!/usr/bin/perl -w
$uptime = `/usr/bin/uptime`;
@s = lstat '/dev/pts' or die $uptime;
$s = time - $s[10];
if ($s>172800) {
$d = int($s/86400);
$uptime =~ s/up .*?,/up $d days,/;
} else {
$h = int($s/3600);
$m = int(($s-$h*3600)/60);
$uptime =~ s/up .*?,/sprintf("up %02d:%02d,",$h,$m)/e;
}
print $uptime;
with greetings
Guido
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Lxc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lxc-users