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

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

    <bug>
          <bug_id>61107</bug_id>
          
          <creation_ts>2026-10-16 22:55:25 +0300</creation_ts>
          <short_desc>icecast: нет systemd-юнита; под systemd служба не держит процесс, pidfile в icecast.xml не совпадает с init-скриптом</short_desc>
          <delta_ts>2026-10-17 02:26:39 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Branch p11</product>
          <component>icecast</component>
          <version>unspecified</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>ASSIGNED</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 Lipatov">lav</reporter>
          <assigned_to name="Vitaly Lipatov">lav</assigned_to>
          
          
          <qa_contact name="qa-p11@altlinux.org">qa-p11</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>302678</commentid>
    <comment_count>0</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2026-10-16 22:55:25 +0300</bug_when>
    <thetext>icecast-2.4.4-alt2 (p11, x86_64; в LXC с systemd).

1. В пакете нет systemd-юнита, только /etc/rc.d/init.d/icecast. Юнит из systemd-sysv-generator (Type=forking, GuessMainPID=no, RemainAfterExit=yes): после `systemctl start icecast` служба «active (exited)», а процесс `icecast -b` вскоре исчезает (в журнале icecast — ни строки). Тот же init-скрипт, запущенный напрямую из shell, и `icecast -b -c /etc/icecast.xml` вручную работают. Обходной путь — свой юнит: Type=simple, ExecStartPre=/etc/chroot.d/icecast.all, ExecStart=/bin/icecast -c /etc/icecast.xml (без -b), ExecReload=/bin/kill -HUP $MAINPID.

2. Пакетный /etc/icecast.xml задаёт `&lt;pidfile&gt;/icecast.pid&lt;/pidfile&gt;`, а init-скрипт ждёт PIDFILE=/var/run/icecast/icecast.pid. В итоге `service icecast restart`/`stop` не находят процесс и не останавливают его, новый запуск молча не стартует (порт занят) — работает старый процесс со старым конфигом. Файл /icecast.pid при этом создаётся в корне ФС.

Предлагаю: добавить icecast.service (Type=simple, без -b) и согласовать pidfile в конфиге с /var/run/icecast/icecast.pid.

Также: в Sisyphus x86_64 пакета icecast сейчас нет (есть только в p11/p10 и sisyphus_e2k/mipsel).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>302683</commentid>
    <comment_count>1</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2026-10-16 23:14:29 +0300</bug_when>
    <thetext>Воспроизведено на p11 icecast-2.4.4-alt2 (docker alt-test:p11, systemd PID 1):
- юнит только сгенерированный systemd-sysv-generator из /etc/rc.d/init.d/icecast, своего icecast.service в пакете нет;
- pidfile создаётся в корне ФС (/icecast.pid), /var/run/icecast/ нет; systemctl stop icecast: &quot;Service icecast is not running&quot;, юнит inactive, но &quot;Unit process ... (icecast) remains running after unit stopped&quot;; systemctl restart: &quot;Could not create listener socket on port 8000 ... Server startup failed&quot; при &quot;[ DONE ]&quot; — работает старый процесс.
Исправление: свой icecast.service (Type=simple, ExecStartPre=/etc/chroot.d/icecast.all, ExecStart без -b, ExecReload=kill -HUP $MAINPID) и согласованный pidfile/init-скрипт. Сначала в Sisyphus (пакет туда возвращается), затем тем же релизом в p11 и c11f1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>302688</commentid>
    <comment_count>2</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2026-10-17 02:26:39 +0300</bug_when>
    <thetext>Дополнение: перечитать конфиг по HUP (systemctl reload) нельзя при &lt;chroot&gt;1&lt;/chroot&gt;, который включён в пакетном /etc/icecast.xml.

После перехода в chroot (/var/lib/icecast) icecast уже не видит /etc/icecast.xml. По HUP в error.log:

  WARN config failed to load external entity &quot;/etc/icecast.xml&quot;
  EROR event/event_config_read Parse error in reading /etc/icecast.xml
  EROR event/event_config_read Error parsing config, not replacing existing config

Служба продолжает работать со старым конфигом, а systemctl reload (и service icecast reload) возвращает успех, так что ошибку легко не заметить.

Предложение:
- в юните не задавать ExecReload: изменения применяются только restart, источник переподключается за несколько секунд;
- либо держать копию конфига внутри chroot (ExecStartPre копирует /etc/icecast.xml в /var/lib/icecast/etc/ и icecast запускается с ней) — тогда HUP работает.

Проверено на icecast-2.4.4-alt2 (p11), x86_64.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>