Re: Container Uptime Discussion

Jim Warner <[email protected]> Thu, 8 Feb 2024 13:02:48 -0600
Newsgroups gmane.linux.procps.devel
Message-ID <[email protected]>
My apologies, Craig.

Forget my prior BS about the --container switch not working under 
docker.  It's fine.

[ I'm too embarrassed to explain what I did wrong. ]

So we're left with just the --help issue and possibly the following.

Under lxc, /proc/uptime is adjusted to reflect the container's proper 
uptime.  That renders TIME_ELAPSED for pid #1 useless as the task 
start_time is greater than the reported /proc/uptime * hertz.  Thus, the 
<pids> api will always return zero.

If the new procps_container_uptime() function were to first check for 
the above anomaly, it could just return with the existing 
procps_uptime() seconds instead of zero otherwise.

Regards,

Jim