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

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

    <bug>
          <bug_id>45005</bug_id>
          
          <creation_ts>2023-01-23 16:49:59 +0300</creation_ts>
          <short_desc>сервис haproxy не запускается</short_desc>
          <delta_ts>2023-01-26 20:25:45 +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>haproxy</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="Pavel Shilov">shilovps</reporter>
          <assigned_to name="Alexey Shabalin">shaba</assigned_to>
          <cc>shaba</cc>
    
    <cc>usoltsev05</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>220500</commentid>
    <comment_count>0</comment_count>
    <who name="Pavel Shilov">shilovps</who>
    <bug_when>2023-01-23 16:49:59 +0300</bug_when>
    <thetext>Проверку производил на платформe:
* p10-server-10-x86-64

Версия пакета: 
* haproxy-2.6.6-alt1

Шаги воспроизведения:
Для тестирования необходимы три машины: haproxy, webserver1, webserver2
1 Настройка web серверов:
# apt-get install apache2-base
# hostnamectl set-hostname webserver{1,2}
2 на сервере haproxy :
2.1 Сохраняем старую конфигурацию в файл old.haproxy
# mv /etc/haproxy/haproxy.cfg /etc/haproxy/old.haproxy
2.2 Создаем новую конфигурацию с тремя серверами webserver{1,2} - имена хостов web серверов, &lt;ip_server{1,2}&gt; - их адреса
# cat &gt;  /etc/haproxy/haproxy.cfg &lt;&lt; EOF

global
   log         127.0.0.1 local2
   chroot      /var/lib/haproxy
   pidfile     /var/run/haproxy.pid
   maxconn     4000
   user        _haproxy
   group       _haproxy
   daemon
   stats socket /var/lib/haproxy/stats

defaults
   mode                    http
   log                     global
   option                  httplog
   option                  dontlognull
   option http-server-close
   option forwardfor       except 127.0.0.0/8
   option                  redispatch
   retries                 3
   timeout http-request    10s
   timeout queue           1m
   timeout connect         10s
   timeout client          1m
   timeout server          1m
   timeout http-keep-alive 10s
   timeout check           10s
   maxconn                 3000

listen TEST_APP
bind 0.0.0.0:80
mode http
stats enable
stats uri /haproxy?stats

stats auth test:1
balance roundrobin
option httpclose
option forwardfor
server webserver1 &lt;ip_server1&gt;:80 check
server webserver2 &lt;ip_server1&gt;:80 check
EOF
2.3 Проверяем настройку haproxy 
# haproxy -v


Ожидаемый результат haproxy -v 
# haproxy -v
HA-Proxy version 2.3.9-53945bf8c 2021/03/30 - https://haproxy.org/
Status: stable branch - will stop receiving fixes around Q1 2022.
Known bugs: http://www.haproxy.org/bugs/bugs-2.3.9.html
Running on: Linux 5.15.88-un-def-alt1 #1 SMP PREEMPT Sat Jan 14 15:17:33 UTC 2023 x86_64


Фактический результат haproxy -v 
# haproxy -v
FATAL ERROR: invalid code detected -- cannot go further, please recompile!
The source code was miscompiled by the compiler, which usually indicates that
some of the CFLAGS needed to work around overzealous compiler optimizations
were overwritten at build time. Please do not force CFLAGS, and read Makefile
and INSTALL files to decide on the best way to pass your local build options.

Build options :
  TARGET  = linux-glibc
  CPU     = generic
  CC      = cc
  CFLAGS  = -pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto
  OPTIONS = USE_PCRE2=1 USE_OPENSSL=1 USE_LUA=1 USE_ZLIB=1 USE_SYSTEMD=1 USE_PROMEX=1
  DEBUG   = -DDEBUG_STRICT -DDEBUG_MEMORY_POOLS


Сервис haproxy не стартует
# systemctl status haproxy
× haproxy.service - HAProxy Load Balancer
     Loaded: loaded (/lib/systemd/system/haproxy.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Mon 2023-01-23 16:35:48 MSK; 8s ago
       Docs: man:haproxy(1)
    Process: 4537 ExecStartPre=/usr/sbin/haproxy -f $CONFIG -c -q $EXTRAOPTS (code=exited, status=1/FAILURE)
        CPU: 89ms

янв 23 16:35:48 server-10-x86-64-20230123.localdomain systemd[1]: haproxy.service: Scheduled restart job, restart counter is at 5.
янв 23 16:35:48 server-10-x86-64-20230123.localdomain systemd[1]: Stopped HAProxy Load Balancer.
янв 23 16:35:48 server-10-x86-64-20230123.localdomain systemd[1]: haproxy.service: Start request repeated too quickly.
янв 23 16:35:48 server-10-x86-64-20230123.localdomain systemd[1]: haproxy.service: Failed with result &apos;exit-code&apos;.
янв 23 16:35:48 server-10-x86-64-20230123.localdomain systemd[1]: Failed to start HAProxy Load Balancer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220501</commentid>
    <comment_count>1</comment_count>
    <who name="Pavel Shilov">shilovps</who>
    <bug_when>2023-01-23 17:02:08 +0300</bug_when>
    <thetext>Обсуждение в данной ветке https://bugs.archlinux.org/task/71861</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220776</commentid>
    <comment_count>2</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2023-01-26 20:25:45 +0300</bug_when>
    <thetext>haproxy-2.6.8-alt1 -&gt; sisyphus:

 Thu Jan 26 2023 Alexey Shabalin &lt;shaba@altlinux&gt; 2.6.8-alt1
 - 2.6.8
 - build iprange utils
 - add support configs dir /etc/haproxy/conf.d
 - fixed CFLAGS (ALT #45005)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>