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

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

    <bug>
          <bug_id>49197</bug_id>
          
          <creation_ts>2024-01-26 13:28:17 +0300</creation_ts>
          <short_desc>Не выполняются скрипты из /etc/profile.d в сессии kde5 на wayland</short_desc>
          <delta_ts>2024-01-30 12:58:19 +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>plasma5-workspace</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugzilla.altlinux.org/show_bug.cgi?id=38397</see_also>
    
    <see_also>https://bugzilla.altlinux.org/show_bug.cgi?id=40910</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>33000</blocked>
    
    <blocked>46625</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Антон Мидюков">antohami</reporter>
          <assigned_to name="Sergey V Turchin">zerg</assigned_to>
          <cc>aen</cc>
    
    <cc>aris</cc>
    
    <cc>glebfm</cc>
    
    <cc>golubevan</cc>
    
    <cc>iv</cc>
    
    <cc>manowar</cc>
    
    <cc>mcpain</cc>
    
    <cc>placeholder</cc>
    
    <cc>zerg</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>240683</commentid>
    <comment_count>0</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2024-01-26 13:28:17 +0300</bug_when>
    <thetext>Почему-то не выполняются скрипты из /etc/profile.d в сессии на wayland.
Замечено на ALT Regular KDE5:
https://bugzilla.altlinux.org/show_bug.cgi?id=38397#c9</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240685</commentid>
    <comment_count>1</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2024-01-26 14:42:54 +0300</bug_when>
    <thetext>А кем бы они должны выполняться?

P.S.
Интересно, в GNOME тоже?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240687</commentid>
    <comment_count>2</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2024-01-26 14:46:52 +0300</bug_when>
    <thetext>(Ответ для Sergey V Turchin на комментарий #1)
&gt; А кем бы они должны выполняться?
Точнее, кем бы могли?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240689</commentid>
    <comment_count>3</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2024-01-26 14:58:33 +0300</bug_when>
    <thetext>(Ответ для Sergey V Turchin на комментарий #1)
&gt; А кем бы они должны выполняться?
&gt; 
&gt; P.S.
&gt; Интересно, в GNOME тоже?

В GNOME на wayland выполняются. Не знаю кем.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240690</commentid>
    <comment_count>4</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2024-01-26 15:03:53 +0300</bug_when>
    <thetext>Будем посмотреть.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240693</commentid>
    <comment_count>5</comment_count>
    <who name="Yuri N. Sedunov">aris</who>
    <bug_when>2024-01-26 15:47:04 +0300</bug_when>
    <thetext>(Ответ для Антон Мидюков на комментарий #3)

&gt; В GNOME на wayland выполняются. Не знаю кем.

Так же как и на x11 -- GDM&apos;ом.

$ grep profile /etc/gdm/Xsession
# This is why we source the profile files below.
# read /etc/profile and .bash_profile
test -f /etc/profile &amp;&amp; . /etc/profile
test -f &quot;$HOME/.bash_profile&quot; &amp;&amp; . &quot;$HOME/.bash_profile&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240697</commentid>
    <comment_count>6</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2024-01-26 16:45:45 +0300</bug_when>
    <thetext>(Ответ для Yuri N. Sedunov на комментарий #5)
&gt; Так же как и на x11 -- GDM&apos;ом.
&gt; $ grep profile /etc/gdm/Xsession
Xsession в Wayland выполняться не должон.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240709</commentid>
    <comment_count>7</comment_count>
    <who name="Yuri N. Sedunov">aris</who>
    <bug_when>2024-01-26 17:58:45 +0300</bug_when>
    <thetext>/etc/gdm/Xsession не то же самое что /etc/X11/Xsession</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240710</commentid>
    <comment_count>8</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2024-01-26 18:23:00 +0300</bug_when>
    <thetext>/etc/profile.d/*.sh выполняются при логине в bash. gnome на wayland запускает bash -l. И phosh тоже так делает.
А вот kde5 у нас напрямую бинарик /usr/bin/startplasma-wayland запускает из /usr/share/wayland-session/plasmawayland.desktop
Думаю, что дело в этом.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240794</commentid>
    <comment_count>9</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2024-01-29 11:23:15 +0300</bug_when>
    <thetext>(Ответ для Yuri N. Sedunov на комментарий #7)
&gt; /etc/gdm/Xsession не то же самое что /etc/X11/Xsession
Там &quot;This is SORT OF LIKE an X session&quot;.
Да и название от этого другим не стало.
Я к тому, что это костыль и в Wayland это выполняться не должно.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240823</commentid>
    <comment_count>10</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2024-01-29 14:57:57 +0300</bug_when>
    <thetext>В Fedora этим занимается /etc/bashrc</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240825</commentid>
    <comment_count>11</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2024-01-29 15:04:25 +0300</bug_when>
    <thetext>(In reply to Sergey V Turchin from comment #10)
&gt; В Fedora этим занимается /etc/bashrc

В Альте /etc/bashrc загружает только /etc/bashrc.d/*.sh.
Перевесьте на нужный пакет, пожалуйста.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240828</commentid>
    <comment_count>12</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2024-01-29 15:21:59 +0300</bug_when>
    <thetext>(Ответ для Dmitry V. Levin на комментарий #11)
&gt; В Альте /etc/bashrc загружает только /etc/bashrc.d/*.sh.
Значит, надо, чтоб нужные скрипты из /etc/profile.d/ имели файлы в /etc/bashrc.d/ .</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240830</commentid>
    <comment_count>13</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2024-01-29 15:26:50 +0300</bug_when>
    <thetext>(Ответ для Sergey V Turchin на комментарий #12)
&gt; (Ответ для Dmitry V. Levin на комментарий #11)
&gt; &gt; В Альте /etc/bashrc загружает только /etc/bashrc.d/*.sh.
&gt; Значит, надо, чтоб нужные скрипты из /etc/profile.d/ имели файлы в
&gt; /etc/bashrc.d/ .

1. чем запуск bash -l не устраивает?
2. а это точно хорошая идея пихать всякое этакое в /etc/profile.d/, которое выполняется при логине в консольном tty?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240833</commentid>
    <comment_count>14</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2024-01-29 15:36:20 +0300</bug_when>
    <thetext>(Ответ для Антон Мидюков на комментарий #13)
&gt; 2. а это точно хорошая идея пихать всякое этакое в /etc/profile.d/, которое
&gt; выполняется при логине в консольном tty?
Видимо, у Fedora нет проблем.
Ты не путаешь с /etc/X11/xinit.d/ ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240834</commentid>
    <comment_count>15</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2024-01-29 15:51:44 +0300</bug_when>
    <thetext>(Ответ для Sergey V Turchin на комментарий #14)
&gt; (Ответ для Антон Мидюков на комментарий #13)
&gt; &gt; 2. а это точно хорошая идея пихать всякое этакое в /etc/profile.d/, которое
&gt; &gt; выполняется при логине в консольном tty?
&gt; Видимо, у Fedora нет проблем.
&gt; Ты не путаешь с /etc/X11/xinit.d/ ?

Нет. Я про /etc/profile.d/
Что туда только не помещаем. Смотреть пакеты:
chromium-disable-webfonts
dconf-defaults-tablet
kde5-profile
flatpak
fcitx5-autostart

И только в fcitx5-autostart условие есть, чтобы в tty не выполнялось.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240839</commentid>
    <comment_count>16</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2024-01-29 16:32:22 +0300</bug_when>
    <thetext>(Ответ для Антон Мидюков на комментарий #15)
&gt; &gt; Видимо, у Fedora нет проблем.
&gt; &gt; Ты не путаешь с /etc/X11/xinit.d/ ?
&gt; Нет. Я про /etc/profile.d/
&gt; Что туда только не помещаем.
Не так уж много. Перечисленные или пофиксить или нормально или у остальных так же.

В Ubuntu, например, snap тоже в консоли переменные ставит.
А вот, кто /etc/profile всасывает, что-то не найду...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240840</commentid>
    <comment_count>17</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2024-01-29 16:38:22 +0300</bug_when>
    <thetext>(Ответ для Sergey V Turchin на комментарий #16)
&gt; (Ответ для Антон Мидюков на комментарий #15)
&gt; &gt; &gt; Видимо, у Fedora нет проблем.
&gt; &gt; &gt; Ты не путаешь с /etc/X11/xinit.d/ ?
&gt; &gt; Нет. Я про /etc/profile.d/
&gt; &gt; Что туда только не помещаем.
&gt; Не так уж много. Перечисленные или пофиксить или нормально или у остальных
&gt; так же.
&gt; 
&gt; В Ubuntu, например, snap тоже в консоли переменные ставит.
&gt; А вот, кто /etc/profile всасывает, что-то не найду...

man bash:
When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first  reads  and  executes  commands
       from  the  file  /etc/profile,  if that file exists.  After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that
       order, and reads and executes commands from the first one that exists and is readable.  The --noprofile option  may  be  used  when  the  shell  is
       started to inhibit this behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240841</commentid>
    <comment_count>18</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2024-01-29 16:41:57 +0300</bug_when>
    <thetext>(Ответ для Антон Мидюков на комментарий #17)
&gt; &gt; А вот, кто /etc/profile всасывает, что-то не найду...
&gt; man bash:
comment#10</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240844</commentid>
    <comment_count>19</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2024-01-29 16:50:38 +0300</bug_when>
    <thetext>(Ответ для Sergey V Turchin на комментарий #10)
&gt; В Fedora этим занимается /etc/bashrc
В Ubuntu тоже нашёл упоминания, что /etc/profile и /etc/profile.d/*.sh загружает bash. Конкретного места не нашёл.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240846</commentid>
    <comment_count>20</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2024-01-29 17:05:15 +0300</bug_when>
    <thetext>(Ответ для Sergey V Turchin на комментарий #19)
&gt; (Ответ для Sergey V Turchin на комментарий #10)
&gt; &gt; В Fedora этим занимается /etc/bashrc
&gt; В Ubuntu тоже нашёл упоминания, что /etc/profile и /etc/profile.d/*.sh
&gt; загружает bash. Конкретного места не нашёл.

man&apos;у веры нет? При логине SHELL&apos;ы грузят /etc/profile.d/*.{такой-то_shell}
Примеры запуска сеансов на wayland:
https://git.altlinux.org/srpms/p/phosh.git?p=phosh.git;a=blob;f=phosh/data/phosh-session.in;h=33d740db2859a580a3e90e869003bf933e7693ae;hb=0.35.0-alt1#l57
и
https://git.altlinux.org/srpms/g/gnome-session.git?p=gnome-session.git;a=blob;f=gnome-session/gnome-session/gnome-session.in;h=b43ebaac3e6fa5930203d91a5aa68ab9254a888f;hb=45.0-alt1.1#l10</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240847</commentid>
    <comment_count>21</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2024-01-29 17:09:34 +0300</bug_when>
    <thetext>(Ответ для Антон Мидюков на комментарий #13)
&gt; 1. чем запуск bash -l не устраивает?
Да, я и не уверен пока, что bashrc поможет.

Надо ж в Wayland перед запуском сессии как-то, а там далеко не всегда есть bash...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240848</commentid>
    <comment_count>22</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2024-01-29 17:18:04 +0300</bug_when>
    <thetext>По итогу, bashrc тут ни при чём. Возвращаю обратно и переоткрываю.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240866</commentid>
    <comment_count>23</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2024-01-30 09:25:48 +0300</bug_when>
    <thetext>У sddm в Ubuntu нашёл, что есть отдельный скрипт wayland-session, рядом и схожий с егошним Xsession, следовательно у lightdm должно быть что-то схожее, но не нашёл.

P.S.
Наш gdm тупо свой же Xsession выполняет для wayland, но это некрасиво.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240867</commentid>
    <comment_count>24</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2024-01-30 09:34:00 +0300</bug_when>
    <thetext>(Ответ для Sergey V Turchin на комментарий #23)
&gt; У sddm в Ubuntu нашёл, что есть отдельный скрипт wayland-session, рядом и
&gt; схожий с егошним Xsession, следовательно у lightdm должно быть что-то
&gt; схожее, но не нашёл.
&gt; 
&gt; P.S.
&gt; Наш gdm тупо свой же Xsession выполняет для wayland, но это некрасиво.

Не выполняет. Его можно спокойно удалить и ничего не поменяется для сессии на wayland.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240868</commentid>
    <comment_count>25</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2024-01-30 09:45:43 +0300</bug_when>
    <thetext>&gt; &gt; Наш gdm тупо свой же Xsession выполняет для wayland, но это некрасиво.
&gt; Не выполняет.
Значит, мантейнер gdm ошибся в comment#5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240869</commentid>
    <comment_count>26</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2024-01-30 10:08:52 +0300</bug_when>
    <thetext>    613 ?        SLsl   0:00 /usr/sbin/lightdm
   2038 ?        Sl     0:00  \_ lightdm --session-child 13 20
   2059 ?        Ss     0:00      \_ /bin/sh /usr/lib/x86_64-linux-gnu/libexec/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland
   2123 ?        R      0:00          \_ ps axf

В Debian/Ubuntu это делает bash. В скрипте plasma-dbus-run-session-if-needed в момент перед выполнением startplasma-wayland переменные уже выставлены.

P.S.
Ща проверю, если у нас в шебанг скрипта вставить -l, благо он мой.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240870</commentid>
    <comment_count>27</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2024-01-30 10:12:41 +0300</bug_when>
    <thetext>(Ответ для Sergey V Turchin на комментарий #26)
&gt; Ща проверю, если у нас в шебанг скрипта вставить -l, благо он мой.
Прокатило. Ща упакую.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240871</commentid>
    <comment_count>28</comment_count>
    <who name="Антон Мидюков">antohami</who>
    <bug_when>2024-01-30 10:17:06 +0300</bug_when>
    <thetext>(Ответ для Sergey V Turchin на комментарий #27)
&gt; (Ответ для Sergey V Turchin на комментарий #26)
&gt; &gt; Ща проверю, если у нас в шебанг скрипта вставить -l, благо он мой.
&gt; Прокатило. Ща упакую.

Подожди. Для сеанса иксов не надо этот логин совершать. Может что-то неожиданное вылезти.
Сделай по аналогии с gnome-session:
https://git.altlinux.org/srpms/g/gnome-session.git?p=gnome-session.git;a=blob;f=gnome-session/gnome-session/gnome-session.in;h=b43ebaac3e6fa5930203d91a5aa68ab9254a888f;hb=45.0-alt1.1#l10</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240873</commentid>
    <comment_count>29</comment_count>
    <who name="Sergey V Turchin">zerg</who>
    <bug_when>2024-01-30 10:47:58 +0300</bug_when>
    <thetext>(Ответ для Антон Мидюков на комментарий #28)
&gt; Подожди. Для сеанса иксов не надо этот логин совершать. Может что-то
&gt; неожиданное вылезти.
plasma-dbus-run-session-if-needed используется только для запуска Wayland-сессии в /usr/share/wayland-sessions/plasmawayland.desktop в Exec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240889</commentid>
    <comment_count>30</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2024-01-30 12:58:19 +0300</bug_when>
    <thetext>plasma5-workspace-1:5.27.10-alt3 -&gt; sisyphus:

 Tue Jan 30 2024 Sergey V Turchin &lt;zerg@altlinux&gt; 1:5.27.10-alt3
 - force run /etc/profile at wayland session start (closes: 49197)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>