• Bug#1066090: psmisc: killall --older-than doesn't work as documented in

    From Craig Small@21:1/5 to Tim Connors on Wed Mar 13 12:00:01 2024
    Control: tag 1066090 fixed-upstream

    On Wed, 13 Mar 2024 at 00:30, Tim Connors <tim.w.connors@gmail.com> wrote:

    I'm guessing it's looking at field 22 starttime in /proc/$pid/stat?
    starttime is seconds since boot. Since the process exists in the
    parent system as well, starttime will surely be seconds since host
    boot? But /proc/uptime is seconds since container boot.

    /proc/uptime is sometimes seconds since host boot and sometimes seconds
    since container boot.

    Generally docker is the former, LXC is the latter but it's not consistent.
    You can tell because if you run the uptime command
    you'll see the difference. LXC basically overrides the uptime file with a fuse-mounted file.You'd probably see there
    is an issue with things like "ps -o etimes" as well which is where this
    first was noticed.

    There is already an upstream fix for this[1] in procps which uses clock_gettime() instead so the start times are correct.
    killall would be impacted by the same issue.
    - Craig

    1: https://gitlab.com/procps-ng/procps/-/commit/b5e19c1730bcc68d553f44b5585704e3c92267bf#83c45d853acc8384452b404946e4a0c484b16a4e_1519_1515

    <div dir="ltr"><div>Control: tag 1066090 fixed-upstream</div><div><br></div><div dir="ltr">On Wed, 13 Mar 2024 at 00:30, Tim Connors &lt;<a href="mailto:tim.w.connors@gmail.com" target="_blank">tim.w.connors@gmail.com</a>&gt; wrote:</div><div class="
    gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"></blockquote><div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,
    204,204);padding-left:1ex">I&#39;m guessing it&#39;s looking at field 22 starttime in /proc/$pid/stat?<br>
    starttime is seconds since boot.  Since the process exists in the<br>
    parent system as well, starttime will surely be seconds since host<br>
    boot?  But /proc/uptime is seconds since container boot.<br></blockquote><div>/proc/uptime is sometimes seconds since host boot and sometimes seconds since container boot.</div><div><br></div><div>Generally docker is the former, LXC is the latter but it&
    #39;s not consistent. You can tell because if you run the uptime command</div><div>you&#39;ll see the difference. LXC basically overrides the uptime file with a fuse-mounted file.You&#39;d probably see there<div>is an issue with things like &quot;ps -o
    etimes&quot; as well which is where this first was noticed.</div></div><div><br></div><div>There is already an upstream fix for this[1] in procps which uses clock_gettime() instead so the start times are correct. <br></div><div>killall would be impacted
    by the same issue.<br></div><div> - Craig</div><div></div><div><br></div><div>1: <a href="https://gitlab.com/procps-ng/procps/-/commit/b5e19c1730bcc68d553f44b5585704e3c92267bf#83c45d853acc8384452b404946e4a0c484b16a4e_1519_1515" target="_blank">https://
    gitlab.com/procps-ng/procps/-/commit/b5e19c1730bcc68d553f44b5585704e3c92267bf#83c45d853acc8384452b404946e4a0c484b16a4e_1519_1515</a></div><br></div></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)