On Fri 2012-05-04 (00:05), Samuel Maftoul wrote: > Maybe, the uptime of container's init process will show you uptime of the > container (so is accessible from within the container).
init does not provide its start time I have now written a special uptime command to be placed in the containers PATH: #!/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; -- Ullrich Horlacher Server- und Arbeitsplatzsysteme Rechenzentrum E-Mail: horlac...@rus.uni-stuttgart.de Universitaet Stuttgart Tel: ++49-711-685-65868 Allmandring 30 Fax: ++49-711-682357 70550 Stuttgart (Germany) WWW: http://www.rus.uni-stuttgart.de/ REF: <cafj+z05p7uej9ivh49egg3kbgi0rrg9wym5y0ejcv5etdzm...@mail.gmail.com> ------------------------------------------------------------------------------ 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 Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users