<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>47624</bug_id>
          
          <creation_ts>2023-09-18 13:43:18 +0300</creation_ts>
          <short_desc>hasher-privd[940466]: join_caller_cgroup: cgroup: not version 2</short_desc>
          <delta_ts>2025-09-21 21:38:01 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>hasher-priv</component>
          <version>unstable</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Vitaly Chikunov">vt</reporter>
          <assigned_to name="Dmitry V. Levin">ldv</assigned_to>
          <cc>ildar</cc>
    
    <cc>ldv</cc>
    
    <cc>placeholder</cc>
    
    <cc>vladisbabenko96</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>233387</commentid>
    <comment_count>0</comment_count>
    <who name="Vitaly Chikunov">vt</who>
    <bug_when>2023-09-18 13:43:18 +0300</bug_when>
    <thetext>После запуска контейнера (с nixos) через machinectl (systemd-nspawn) hasher-privd перестает работать с ошибками вида:

  $ gear-hsh --commit 2&gt;&amp;1 |&amp; tee log
  hasher-priv: xrecvmsg: recvmsg: unexpected EOF
  hasher-priv: recv_response: failed to receive header in response to run
  hsh-rmchroot: Failed to remove files owned by user2.

  ...
  hsh-initroot: Unpack of setup-2.2.18-alt1.noarch.rpm failed.

В журнале появляется ошибка:

  hasher-privd[940466]: join_caller_cgroup: cgroup: not version 2

Причина в том что в cgroup появляется &quot;лишняя&quot; строка `1:name=systemd:/`, которую не выносит hasher-priv:

  $ cat /proc/self/cgroup
  1:name=systemd:/
  0::/user.slice/user-500.slice/session-7.scope

Может можно как-то улучшить совместимость hasher-priv с systemd?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>243343</commentid>
    <comment_count>1</comment_count>
    <who name="Vladislav Babenko">vladisbabenko96</who>
    <bug_when>2024-03-22 12:38:56 +0300</bug_when>
    <thetext>(Ответ для Vitaly Chikunov на комментарий #0)
&gt; После запуска контейнера (с nixos) через machinectl (systemd-nspawn)
&gt; hasher-privd перестает работать с ошибками вида:
&gt; 
&gt;   $ gear-hsh --commit 2&gt;&amp;1 |&amp; tee log
&gt;   hasher-priv: xrecvmsg: recvmsg: unexpected EOF
&gt;   hasher-priv: recv_response: failed to receive header in response to run
&gt;   hsh-rmchroot: Failed to remove files owned by user2.
&gt; 
&gt;   ...
&gt;   hsh-initroot: Unpack of setup-2.2.18-alt1.noarch.rpm failed.
&gt; 
&gt; В журнале появляется ошибка:
&gt; 
&gt;   hasher-privd[940466]: join_caller_cgroup: cgroup: not version 2
&gt; 
&gt; Причина в том что в cgroup появляется &quot;лишняя&quot; строка `1:name=systemd:/`,
&gt; которую не выносит hasher-priv:
&gt; 
&gt;   $ cat /proc/self/cgroup
&gt;   1:name=systemd:/
&gt;   0::/user.slice/user-500.slice/session-7.scope
&gt; 
&gt; Может можно как-то улучшить совместимость hasher-priv с systemd?

Я думаю, тут нужно, с другой стороны, подходить и разрешать cgroup2 в контейнере.
Включил поддержку cgroup2, примонтировал и всё собралось без ошибок.
wsl2: https://stackoverflow.com/questions/73021599/how-to-enable-cgroup-v2-in-wsl2

Я не уверен, что это ошибка hasher-privd, максимум, м.б. просто добавил на отдельную проверку контейнера (сейчас он проверяет это при запуске демона), не запрет, а дополнительную проверку на доступ к cgroups2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>272865</commentid>
    <comment_count>2</comment_count>
    <who name="ildar">ildar</who>
    <bug_when>2025-09-21 21:38:01 +0300</bug_when>
    <thetext>(In reply to Vladislav Babenko from comment #1)
&gt; Я думаю, тут нужно, с другой стороны, подходить и разрешать cgroup2 в
&gt; контейнере.
&gt; Включил поддержку cgroup2, примонтировал и всё собралось без ошибок.

По тому, что пишет Виталий, у него ситуация со смешанным CGroup v1+v2.
На данный момент hasher-priv умеет работать, когда в системе CGroup v2: это большинство современных систем и контейнеров.
Однако я запилил патч, который запустит hasher-priv в таких странных системах &quot;переходного периода&quot;: https://altlinux.space/ildar/hasher-priv</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>