<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Приветствую коллеги.</div><div><br></div>Вчера обновил Sisyphus и получил не запускающий lxc на kernel 5.1, но работающий на 5.0, вывод при запуске и быстрый просмотр привел к этим участкам кода в lxc:<div><br></div><div><pre class="gmail-code gmail-highlight" lang="c"><span id="gmail-LC112" class="gmail-line" lang="c"><span class="gmail-kt">int</span> <span class="gmail-nf">lxc_raw_pidfd_send_signal</span><span class="gmail-p">(</span><span class="gmail-kt">int</span> <span class="gmail-n">pidfd</span><span class="gmail-p">,</span> <span class="gmail-kt">int</span> <span class="gmail-n">sig</span><span class="gmail-p">,</span> <span class="gmail-n">siginfo_t</span> <span class="gmail-o">*</span><span class="gmail-n">info</span><span class="gmail-p">,</span></span>
<span id="gmail-LC113" class="gmail-line" lang="c">                         <span class="gmail-kt">unsigned</span> <span class="gmail-kt">int</span> <span class="gmail-n">flags</span><span class="gmail-p">)</span></span>
<span id="gmail-LC114" class="gmail-line" lang="c"><span class="gmail-p">{</span></span>
<span id="gmail-LC115" class="gmail-line" lang="c"><span class="gmail-cp">#ifdef __NR_pidfd_send_signal</span></span>
<span id="gmail-LC116" class="gmail-line" lang="c">        <span class="gmail-n">syscall</span><span class="gmail-p">(</span><span class="gmail-n">__NR_pidfd_send_signal</span><span class="gmail-p">,</span> <span class="gmail-n">pidfd</span><span class="gmail-p">,</span> <span class="gmail-n">sig</span><span class="gmail-p">,</span> <span class="gmail-n">info</span><span class="gmail-p">,</span> <span class="gmail-n">flags</span><span class="gmail-p">);</span></span>
<span id="gmail-LC117" class="gmail-line" lang="c"><span class="gmail-cp">#else</span></span>
<span id="gmail-LC118" class="gmail-line" lang="c">        <span class="gmail-n">errno</span> <span class="gmail-o">=</span> <span class="gmail-n">ENOSYS</span><span class="gmail-p">;</span></span>
<span id="gmail-LC119" class="gmail-line" lang="c"><span class="gmail-cp">#endif</span></span>
<span id="gmail-LC120" class="gmail-line" lang="c">        <span class="gmail-k">return</span> <span class="gmail-o">-</span><span class="gmail-mi">1</span><span class="gmail-p">;</span></span>
<span id="gmail-LC121" class="gmail-line" lang="c"><span class="gmail-p">}</span></span>
</pre><div> и</div><div><pre class="gmail-code gmail-highlight" lang="c"><span id="gmail-LC1581" class="gmail-line" lang="c"><span class="gmail-k">static</span> <span class="gmail-kt">int</span> <span class="gmail-nf">proc_pidfd_open</span><span class="gmail-p">(</span><span class="gmail-n">pid_t</span> <span class="gmail-n">pid</span><span class="gmail-p">)</span></span>
<span id="gmail-LC1582" class="gmail-line" lang="c"><span class="gmail-p">{</span></span>
<span id="gmail-LC1583" class="gmail-line" lang="c">        <span class="gmail-n">__do_close_prot_errno</span> <span class="gmail-kt">int</span> <span class="gmail-n">proc_pidfd</span> <span class="gmail-o">=</span> <span class="gmail-o">-</span><span class="gmail-n">EBADF</span><span class="gmail-p">;</span></span>
<span id="gmail-LC1584" class="gmail-line" lang="c">        <span class="gmail-kt">char</span> <span class="gmail-n">path</span><span class="gmail-p">[</span><span class="gmail-mi">100</span><span class="gmail-p">];</span></span>
<span id="gmail-LC1585" class="gmail-line" lang="c"></span>
<span id="gmail-LC1586" class="gmail-line" lang="c">        <span class="gmail-n">snprintf</span><span class="gmail-p">(</span><span class="gmail-n">path</span><span class="gmail-p">,</span> <span class="gmail-k">sizeof</span><span class="gmail-p">(</span><span class="gmail-n">path</span><span class="gmail-p">),</span> <span class="gmail-s">"/proc/%d"</span><span class="gmail-p">,</span> <span class="gmail-n">pid</span><span class="gmail-p">);</span></span>
<span id="gmail-LC1587" class="gmail-line" lang="c">        <span class="gmail-n">proc_pidfd</span> <span class="gmail-o">=</span> <span class="gmail-n">open</span><span class="gmail-p">(</span><span class="gmail-n">path</span><span class="gmail-p">,</span> <span class="gmail-n">O_DIRECTORY</span> <span class="gmail-o">|</span> <span class="gmail-n">O_RDONLY</span> <span class="gmail-o">|</span> <span class="gmail-n">O_CLOEXEC</span><span class="gmail-p">);</span></span>
<span id="gmail-LC1588" class="gmail-line" lang="c">        <span class="gmail-k">if</span> <span class="gmail-p">(</span><span class="gmail-n">proc_pidfd</span> <span class="gmail-o"><</span> <span class="gmail-mi">0</span><span class="gmail-p">)</span> <span class="gmail-p">{</span></span>
<span id="gmail-LC1589" class="gmail-line" lang="c">                <span class="gmail-n">SYSERROR</span><span class="gmail-p">(</span><span class="gmail-s">"Failed to open %s"</span><span class="gmail-p">,</span> <span class="gmail-n">path</span><span class="gmail-p">);</span></span>
<span id="gmail-LC1590" class="gmail-line" lang="c">                <span class="gmail-k">return</span> <span class="gmail-o">-</span><span class="gmail-mi">1</span><span class="gmail-p">;</span></span>
<span id="gmail-LC1591" class="gmail-line" lang="c">        <span class="gmail-p">}</span></span>
<span id="gmail-LC1592" class="gmail-line" lang="c"></span>
<span id="gmail-LC1593" class="gmail-line" lang="c">        <span class="gmail-cm">/* Test whether we can send signals. */</span></span>
<span id="gmail-LC1594" class="gmail-line" lang="c">        <span class="gmail-k">if</span> <span class="gmail-p">(</span><span class="gmail-n">lxc_raw_pidfd_send_signal</span><span class="gmail-p">(</span><span class="gmail-n">proc_pidfd</span><span class="gmail-p">,</span> <span class="gmail-mi">0</span><span class="gmail-p">,</span> <span class="gmail-nb">NULL</span><span class="gmail-p">,</span> <span class="gmail-mi">0</span><span class="gmail-p">))</span> <span class="gmail-p">{</span></span>
<span id="gmail-LC1595" class="gmail-line" lang="c">                <span class="gmail-n">SYSERROR</span><span class="gmail-p">(</span><span class="gmail-s">"Failed to send signal through pidfd"</span><span class="gmail-p">);</span></span>
<span id="gmail-LC1596" class="gmail-line" lang="c">                <span class="gmail-k">return</span> <span class="gmail-o">-</span><span class="gmail-mi">1</span><span class="gmail-p">;</span></span>
<span id="gmail-LC1597" class="gmail-line" lang="c">        <span class="gmail-p">}</span></span>
<span id="gmail-LC1598" class="gmail-line" lang="c"></span>
<span id="gmail-LC1599" class="gmail-line" lang="c">        <span class="gmail-k">return</span> <span class="gmail-n">move_fd</span><span class="gmail-p">(</span><span class="gmail-n">proc_pidfd</span><span class="gmail-p">);</span></span>
<span id="gmail-LC1600" class="gmail-line" lang="c"><span class="gmail-p">}</span></span></pre>Что на мой взгляд не будет работать от слова никогда, </div><div><br></div><div>В <a href="https://gitlab.kaist.ac.kr/3rdparty/lxc/commit/cf38fe06aca7306cb244d0c7301b2d0589084d63">https://gitlab.kaist.ac.kr/3rdparty/lxc/commit/cf38fe06aca7306cb244d0c7301b2d0589084d63</a> вроде как фикс на это.</div><div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>С уважением Игорь.<br></div></div></div></div></div></div></div></div></div></div>