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

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

    <bug>
          <bug_id>41487</bug_id>
          
          <creation_ts>2021-12-02 15:50:39 +0300</creation_ts>
          <short_desc>Не перезапускать в процессе обновления</short_desc>
          <delta_ts>2021-12-19 02:42:35 +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>unit</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</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="Anton Farygin">rider</reporter>
          <assigned_to name="Vitaly Chikunov">vt</assigned_to>
          <cc>andy</cc>
    
    <cc>ldv</cc>
    
    <cc>rider</cc>
    
    <cc>vseleznv</cc>
    
    <cc>vt</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>205603</commentid>
    <comment_count>0</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2021-12-02 15:50:39 +0300</bug_when>
    <thetext>Обновление с версии 1.25 до версии 1.26 приводит к ошибке загрузки python модуля.

Всё потому что python модуль обновляется чуть позже чем надо.

Для исправления этой ошибки достаточно просто удалить из spec&apos;а:
%post
%post_service unit

%preun
%preun_service unit


Вот как выглядит обновление в логах:
2021/12/02 15:40:32 [info] 64104#64117 *15804 send(12, 7F7249341C31, 635393) failed (32: Broken pipe)
2021/12/02 15:40:37 [alert] 64101#64101 sendmsg(12, -1, -1, 1) failed (32: Broken pipe)
2021/12/02 15:40:37 [notice] 64101#64101 process 64103 exited with code 0
2021/12/02 15:40:37 [notice] 64101#64101 process 64104 exited with code 0
2021/12/02 15:40:37 [notice] 64101#64101 process 66203 exited with code 0
2021/12/02 15:40:37 [notice] 64101#64101 process 66201 exited with code 0
2021/12/02 15:40:37 [notice] 64101#64101 process 66205 exited with code 0
2021/12/02 15:40:37 [notice] 64101#64101 process 66202 exited with code 0
2021/12/02 15:40:37 [notice] 64101#64101 process 66204 exited with code 0
2021/12/02 15:40:37 [notice] 64101#64101 process 66209 exited with code 0
2021/12/02 15:40:37 [notice] 64101#64101 process 66206 exited with code 0
2021/12/02 15:40:37 [notice] 64101#64101 process 66207 exited with code 0
2021/12/02 15:40:37 [notice] 64101#64101 process 66210 exited with code 0
2021/12/02 15:40:37 [notice] 64101#64101 process 66208 exited with code 0
2021/12/02 15:40:37 [info] 66631#66631 discovery started
2021/12/02 15:40:37 [notice] 66631#66631 module: python 3.9.6 &quot;/usr/lib64/unit/modules/python3.unit.so&quot;
2021/12/02 15:40:37 [notice] 66631#66631 incompatible module /usr/lib64/unit/modules/python3.unit.so
2021/12/02 15:40:37 [info] 66630#66630 controller started
2021/12/02 15:40:37 [notice] 66630#66630 process 66631 exited with code 0
2021/12/02 15:40:37 [alert] 66632#66632 the previous configuration is invalid: The module to run &quot;python&quot; is not found among the available application modules.
2021/12/02 15:40:37 [info] 66633#66633 router started</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205604</commentid>
    <comment_count>1</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2021-12-02 16:13:05 +0300</bug_when>
    <thetext>(In reply to Anton Farygin from comment #0)
&gt; Обновление с версии 1.25 до версии 1.26 приводит к ошибке загрузки python
&gt; модуля.
&gt; 
&gt; Всё потому что python модуль обновляется чуть позже чем надо.

Значит, зависимости надо ставить.

&gt; Для исправления этой ошибки достаточно просто удалить из spec&apos;а:
&gt; %post
&gt; %post_service unit
&gt; 
&gt; %preun
&gt; %preun_service unit

Это по определению не может быть правильно.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205605</commentid>
    <comment_count>2</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2021-12-02 16:14:53 +0300</bug_when>
    <thetext>Зависимости не помогут - я встречал ситуации, когда apt&apos;у тяжело выстроить правильную очерёдность и он выстраивает порядок обновлёния всё равно не так, как нужно приложению.

Удаления %post_service недостаточно, конечно же надо добавить filetrigger для перезапуска.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205606</commentid>
    <comment_count>3</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2021-12-02 16:18:07 +0300</bug_when>
    <thetext>Строгая зависимость, кстати, есть и она не помогла:
https://beta.packages.altlinux.org/ru/sisyphus/binary/unit-python3/x86_64/depends/2737715197315712736</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205607</commentid>
    <comment_count>4</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2021-12-02 16:18:41 +0300</bug_when>
    <thetext>(In reply to Anton Farygin from comment #2)
&gt; Зависимости не помогут - я встречал ситуации, когда apt&apos;у тяжело выстроить
&gt; правильную очерёдность и он выстраивает порядок обновлёния всё равно не так,
&gt; как нужно приложению.

Если циклических зависимостей нет, то даже apt справляется нормально.
А если есть, то надо их разрывать, иначе это лотерея.

У нас в install check есть диагностика циклических зависимостей, но её, к сожалению, все игнорируют.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205608</commentid>
    <comment_count>5</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2021-12-02 16:22:01 +0300</bug_when>
    <thetext>Если очень интересно, то порядок и пакеты обновления в этой транзакции были такими:
дек 02 15:40:37 frontend-repodb apt-get[66479]: unit-1.26.0-alt1 p10+290332.100.2.1 1638272080 installed
дек 02 15:40:37 frontend-repodb apt-get[66479]: libudev1-1:249.5-alt2 p10+288309.100.1.1 1635461987 installed
дек 02 15:40:38 frontend-repodb apt-get[66479]: udev-1:249.5-alt2 p10+288309.100.1.1 1635461987 installed
дек 02 15:40:38 frontend-repodb apt-get[66479]: libapt-0.5.15lorg2-alt73 p10+289181.100.1.1 1636378806 installed
дек 02 15:40:38 frontend-repodb apt-get[66479]: unit-debuginfo-1.26.0-alt1 p10+290332.100.2.1 1638272080 installed
дек 02 15:40:39 frontend-repodb apt-get[66479]: unit-python3-1.26.0-alt1 p10+290332.100.2.1 1638272080 installed
дек 02 15:40:39 frontend-repodb apt-get[66479]: qemu-aux-6.1.0-alt2 p10+289854.40.4.1 1637854614 installed
дек 02 15:40:42 frontend-repodb apt-get[66479]: python3-module-django-3.2.9-alt1 p10+290516.100.1.1 1637753657 installed
дек 02 15:40:42 frontend-repodb apt-get[66479]: glib2-locales-2.68.4-alt2 p10+285934.400.6.1 1637075234 installed
дек 02 15:40:42 frontend-repodb apt-get[66479]: glib2-2.68.4-alt2 p10+285934.400.6.1 1637075234 installed
дек 02 15:40:43 frontend-repodb apt-get[66479]: git-core-2.33.1-alt1 p10+288710.100.2.1 1636957800 installed
дек 02 15:40:43 frontend-repodb apt-get[66479]: perl-Git-2.33.1-alt1 p10+288710.100.2.1 1636957800 installed
дек 02 15:40:43 frontend-repodb apt-get[66479]: libnss-myhostname-1:249.5-alt2 p10+288309.100.1.1 1635461987 installed
дек 02 15:40:43 frontend-repodb apt-get[66479]: pam_systemd-1:249.5-alt2 p10+288309.100.1.1 1635461987 installed
дек 02 15:40:43 frontend-repodb apt-get[66479]: systemd-sysctl-common-1:249.5-alt2 p10+288309.100.1.1 1635461987 installed
дек 02 15:40:43 frontend-repodb apt-get[66479]: systemd-tmpfiles-common-1:249.5-alt2 p10+288309.100.1.1 1635461987 installed
дек 02 15:40:44 frontend-repodb apt-get[66479]: systemd-utils-filetriggers-1:249.5-alt2 p10+288309.100.1.1 1635461987 installed
дек 02 15:40:44 frontend-repodb apt-get[66479]: systemd-utils-1:249.5-alt2 p10+288309.100.1.1 1635461987 installed
дек 02 15:40:44 frontend-repodb apt-get[66479]: systemd-boot-efi-1:249.5-alt2 p10+288309.100.1.1 1635461987 installed
дек 02 15:40:44 frontend-repodb apt-get[66479]: systemd-services-1:249.5-alt2 p10+288309.100.1.1 1635461987 installed
дек 02 15:40:44 frontend-repodb apt-get[66479]: systemd-1:249.5-alt2 p10+288309.100.1.1 1635461987 installed
дек 02 15:40:45 frontend-repodb apt-get[66479]: systemd-networkd-1:249.5-alt2 p10+288309.100.1.1 1635461987 installed
дек 02 15:40:45 frontend-repodb apt-get[66479]: libnss-systemd-1:249.5-alt2 p10+288309.100.1.1 1635461987 installed
дек 02 15:40:46 frontend-repodb apt-get[66479]: libsha1detectcoll1-1.0.3-alt1 p10+288613.40.3.1 1636958799 installed
дек 02 15:40:46 frontend-repodb apt-get[66479]: gnupg-1.4.23-alt4 p10+288613.100.3.1 1636958849 installed
дек 02 15:40:46 frontend-repodb apt-get[66479]: apt-0.5.15lorg2-alt73 p10+289181.100.1.1 1636378806 installed
дек 02 15:40:46 frontend-repodb apt-get[66479]: apt-rsync-0.5.15lorg2-alt73 p10+289181.100.1.1 1636378806 installed
дек 02 15:40:46 frontend-repodb apt-get[66479]: systemd-timesyncd-1:249.5-alt2 p10+288309.100.1.1 1635461987 installed
дек 02 15:40:47 frontend-repodb apt-get[66479]: libnss-resolve-1:249.5-alt2 p10+288309.100.1.1 1635461987 installed
дек 02 15:40:47 frontend-repodb apt-get[66479]: systemd-analyze-1:249.5-alt2 p10+288309.100.1.1 1635461987 installed
дек 02 15:40:47 frontend-repodb apt-get[66479]: systemd-sysvinit-1:249.5-alt2 p10+288309.100.1.1 1635461987 installed
дек 02 15:40:47 frontend-repodb apt-get[66479]: git-2.33.1-alt1 p10+288710.100.2.1 1636957800 installed
дек 02 15:40:47 frontend-repodb apt-get[66479]: qemu-guest-agent-6.1.0-alt2 p10+289854.40.4.1 1637854614 installed
дек 02 15:40:47 frontend-repodb apt-get[66479]: python3-module-django-dbbackend-sqlite3-3.2.9-alt1 p10+290516.100.1.1 1637753657 installed
дек 02 15:40:47 frontend-repodb apt-get[66479]: unit-python3-debuginfo-1.26.0-alt1 p10+290332.100.2.1 1638272080 installed
дек 02 15:40:48 frontend-repodb apt-get[66479]: aptitude-0.4.5-alt13 p10+289181.400.1.1 1636378948 installed
дек 02 15:40:48 frontend-repodb apt-get[66479]: usbutils-014-alt2 p10+289817.100.2.1 1637851778 installed
дек 02 15:40:48 frontend-repodb apt-get[66479]: strace-5.15-alt1 p10+291135.100.1.1 1638392366 installed
дек 02 15:40:48 frontend-repodb apt-get[66479]: pciids-20211122-alt1 p10+290437.100.1.1 1637629645 installed
дек 02 15:40:48 frontend-repodb apt-get[66479]: libsystemd-1:249.5-alt2 p10+288309.100.1.1 1635461987 installed
дек 02 15:40:48 frontend-repodb apt-get[66479]: libpq5-14.1-alt1 p10+289311.100.2.1 1637316056 installed
дек 02 15:40:48 frontend-repodb apt-get[66479]: qemu-guest-agent-6.0.0-alt2 sisyphus+277901.100.1.1 1625918185 removed
дек 02 15:40:48 frontend-repodb apt-get[66479]: unit-python3-debuginfo-1.25.0-alt3 1635231547 removed
дек 02 15:40:48 frontend-repodb apt-get[66479]: systemd-timesyncd-1:249.4-alt2 p10+283536.400.6.1 1631547814 removed
дек 02 15:40:49 frontend-repodb apt-get[66479]: libnss-systemd-1:249.4-alt2 p10+283536.400.6.1 1631547814 removed
дек 02 15:40:49 frontend-repodb apt-get[66479]: unit-python3-1.25.0-alt3 1635231547 removed
дек 02 15:40:49 frontend-repodb apt-get[66479]: unit-debuginfo-1.25.0-alt3 1635231547 removed
дек 02 15:40:49 frontend-repodb apt-get[66479]: glib2-2.68.4-alt1.1 p10+284327.500.7.1 1632403926 removed
дек 02 15:40:49 frontend-repodb apt-get[66479]: usbutils-013-alt1 sisyphus+278999.100.1.1 1626351849 removed
дек 02 15:40:49 frontend-repodb apt-get[66479]: python3-module-django-dbbackend-sqlite3-3.2.6-alt1 p10+283535.200.4.1 1631192647 removed
дек 02 15:40:49 frontend-repodb apt-get[66479]: git-2.29.3-alt2 sisyphus+271077.100.1.1 1619809174 removed
дек 02 15:40:49 frontend-repodb apt-get[66479]: perl-Git-2.29.3-alt2 sisyphus+271077.100.1.1 1619809174 removed
дек 02 15:40:49 frontend-repodb apt-get[66479]: systemd-sysvinit-1:249.4-alt2 p10+283536.400.6.1 1631547814 removed
дек 02 15:40:49 frontend-repodb apt-get[66479]: systemd-analyze-1:249.4-alt2 p10+283536.400.6.1 1631547814 removed
дек 02 15:40:49 frontend-repodb apt-get[66479]: libnss-resolve-1:249.4-alt2 p10+283536.400.6.1 1631547814 removed
дек 02 15:40:49 frontend-repodb apt-get[66479]: systemd-networkd-1:249.4-alt2 p10+283536.400.6.1 1631547814 removed
дек 02 15:40:49 frontend-repodb apt-get[66479]: systemd-1:249.4-alt2 p10+283536.400.6.1 1631547814 removed
дек 02 15:40:50 frontend-repodb apt-get[66479]: systemd-services-1:249.4-alt2 p10+283536.400.6.1 1631547814 removed
дек 02 15:40:50 frontend-repodb apt-get[66479]: systemd-boot-efi-1:249.4-alt2 p10+283536.400.6.1 1631547814 removed
дек 02 15:40:50 frontend-repodb apt-get[66479]: systemd-utils-1:249.4-alt2 p10+283536.400.6.1 1631547814 removed
дек 02 15:40:50 frontend-repodb apt-get[66479]: apt-rsync-0.5.15lorg2-alt72 sisyphus+277626.100.1.2 1625754022 removed
дек 02 15:40:50 frontend-repodb apt-get[66479]: apt-0.5.15lorg2-alt72 sisyphus+277626.100.1.2 1625754022 removed
дек 02 15:40:50 frontend-repodb apt-get[66479]: aptitude-0.4.5-alt13 sisyphus+275612.600.8.1 1624626949 removed
дек 02 15:40:50 frontend-repodb apt-get[66479]: libapt-0.5.15lorg2-alt72 sisyphus+277626.100.1.2 1625754022 removed
дек 02 15:40:50 frontend-repodb apt-get[66479]: gnupg-1.4.23-alt2 sisyphus+279808.100.1.1 1626732185 removed
дек 02 15:40:50 frontend-repodb apt-get[66479]: systemd-utils-filetriggers-1:249.4-alt2 p10+283536.400.6.1 1631547814 removed
дек 02 15:40:50 frontend-repodb apt-get[66479]: systemd-tmpfiles-common-1:249.4-alt2 p10+283536.400.6.1 1631547814 removed
дек 02 15:40:50 frontend-repodb apt-get[66479]: systemd-sysctl-common-1:249.4-alt2 p10+283536.400.6.1 1631547814 removed
дек 02 15:40:50 frontend-repodb apt-get[66479]: pam_systemd-1:249.4-alt2 p10+283536.400.6.1 1631547814 removed
дек 02 15:40:50 frontend-repodb apt-get[66479]: libnss-myhostname-1:249.4-alt2 p10+283536.400.6.1 1631547814 removed
дек 02 15:40:50 frontend-repodb apt-get[66479]: udev-1:249.4-alt2 p10+283536.400.6.1 1631547814 removed
дек 02 15:40:51 frontend-repodb apt-get[66479]: git-core-2.29.3-alt2 sisyphus+271077.100.1.1 1619809174 removed
дек 02 15:40:51 frontend-repodb apt-get[66479]: python3-module-django-3.2.6-alt1 p10+283535.200.4.1 1631192647 removed
дек 02 15:40:51 frontend-repodb apt-get[66479]: libudev1-1:249.4-alt2 p10+283536.400.6.1 1631547814 removed
дек 02 15:40:51 frontend-repodb apt-get[66479]: glib2-locales-2.68.4-alt1.1 p10+284327.500.7.1 1632403926 removed
дек 02 15:40:51 frontend-repodb apt-get[66479]: unit-1.25.0-alt3 1635231547 removed
дек 02 15:40:51 frontend-repodb apt-get[66479]: qemu-aux-6.0.0-alt2 sisyphus+277901.100.1.1 1625918185 removed
дек 02 15:40:51 frontend-repodb apt-get[66479]: strace-5.14-alt1 p10+284534.100.1.1 1630680848 removed
дек 02 15:40:51 frontend-repodb apt-get[66479]: pciids-20211025-alt1 p10+288164.100.1.1 1635210460 removed
дек 02 15:40:51 frontend-repodb apt-get[66479]: libsystemd-1:249.4-alt2 p10+283536.400.6.1 1631547814 removed
дек 02 15:40:51 frontend-repodb apt-get[66479]: libpq5-13.4-alt1 p10+282403.100.1.1 1628676575 removed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205609</commentid>
    <comment_count>6</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2021-12-02 16:24:29 +0300</bug_when>
    <thetext>Если unit при старте загружает плагины из своих подпакетов, то его надо перевести на ту же схему обновления, которую использует postfix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205610</commentid>
    <comment_count>7</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2021-12-02 16:32:36 +0300</bug_when>
    <thetext>Да, конечно можно и также как в postfix&apos;е.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205704</commentid>
    <comment_count>8</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2021-12-04 08:01:04 +0300</bug_when>
    <thetext>unit-1.26.1-alt1 -&gt; sisyphus:

 Sat Dec 04 2021 Vitaly Chikunov &lt;vt@altlinux&gt; 1.26.1-alt1
 - Update to 1.26.1 (2021-12-02).
 - Restart unit from filetrigger (closes: #41487).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205705</commentid>
    <comment_count>9</comment_count>
    <who name="Vitaly Chikunov">vt</who>
    <bug_when>2021-12-04 08:04:35 +0300</bug_when>
    <thetext>Done. Но, мне не нравится в этом подходе, что unitd не будет быстро перезапущен, а будет оставаться остановленным, возможно, долгое время, до от %pre до конца транзакции.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205709</commentid>
    <comment_count>10</comment_count>
    <who name="Anton Farygin">rider</who>
    <bug_when>2021-12-04 12:34:08 +0300</bug_when>
    <thetext>Я тоже об этом думал, и, например, apache перезапускаю в конце транзакции без остановки в процессе обновления. Но у этого подхода есть минус и некоторая вероятность словить невозможность остановить старый процесс с помощью скриптов обновлённого пакета.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>206212</commentid>
    <comment_count>11</comment_count>
    <who name="Vitaly Chikunov">vt</who>
    <bug_when>2021-12-19 02:42:35 +0300</bug_when>
    <thetext>Переделал на %post_service_posttrans_restart.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>