[PATCH] AIX 7.2 support

2020-02-03 Thread Chris
Hello everybody,

I spent some time making haproxy compile and run successfully on AIX
7.2 using GCC 8.3 and wanted to contribute my patch in the hope that
it could be merged. The patch is based on the current haproxy 2.1 head
revision. I can make one for the development branch too - but it
should be basically identical.



--- Makefile.old 2020-02-03 10:56:25.0 +
+++ Makefile 2020-02-03 11:32:00.735254403 +
@@ -144,13 +144,13 @@
 # Use TARGET= to optimize for a specifc target OS among the
 # following list (use the default "generic" if uncertain) :
 #linux-glibc, linux-glibc-legacy, solaris, freebsd, openbsd, netbsd,
-#cygwin, haiku, aix51, aix52, osx, generic, custom
+#cygwin, haiku, aix51, aix52, aix72-gcc, osx, generic, custom
 TARGET =

  TARGET CPU
 # Use CPU= to optimize for a particular CPU, among the following
 # list :
-#generic, native, i586, i686, ultrasparc, custom
+#generic, native, i586, i686, ultrasparc, power8, power9, custom
 CPU = generic

  Architecture, used when not building for native architecture
@@ -257,6 +257,8 @@
 CPU_CFLAGS.i586   = -O2 -march=i586
 CPU_CFLAGS.i686   = -O2 -march=i686
 CPU_CFLAGS.ultrasparc = -O6 -mcpu=v9 -mtune=ultrasparc
+CPU_CFLAGS.power8 = -O2 -mcpu=power8 -mtune=power8
+CPU_CFLAGS.power9 = -O2 -mcpu=power9 -mtune=power9
 CPU_CFLAGS= $(CPU_CFLAGS.$(CPU))

  ARCH dependant flags, may be overridden by CPU flags
@@ -381,7 +383,7 @@
   DEBUG_CFLAGS=
 endif

-# AIX 5.2 and above
+# AIX 5.2
 ifeq ($(TARGET),aix52)
   set_target_defaults = $(call default_opts, \
 USE_POLL USE_LIBCRYPT USE_OBSOLETE_LINKER)
@@ -389,6 +391,14 @@
   DEBUG_CFLAGS=
 endif

+# AIX 7.2 and above
+ifeq ($(TARGET),aix72-gcc)
+  set_target_defaults = $(call default_opts, \
+USE_POLL USE_THREAD USE_LIBCRYPT USE_OBSOLETE_LINKER
USE_GETADDRINFO USE_TFO)
+  TARGET_CFLAGS   = -D_H_XMEM -D_H_VAR
+  TARGET_LDFLAGS  = -latomic
+endif
+
 # Cygwin
 ifeq ($(TARGET),cygwin)
   set_target_defaults = $(call default_opts, \
@@ -754,7 +764,7 @@
  @echo "Please choose the target among the following supported list :"
  @echo
  @echo "   linux-glibc, linux-glibc-legacy, solaris, freebsd, openbsd, netbsd,"
- @echo "   cygwin, haiku, aix51, aix52, osx, generic, custom"
+ @echo "   cygwin, haiku, aix51, aix52, aix72-gcc, osx, generic, custom"
  @echo
  @echo "Use \"generic\" if you don't want any optimization, \"custom\" if you"
  @echo "want to precisely tweak every option, or choose the target which"
@@ -832,7 +842,7 @@
else \
  echo "TARGET not set, you may pass 'TARGET=xxx' to set one among :";\
  echo "  linux-glibc, linux-glibc-legacy, solaris, freebsd,
netbsd, osx,"; \
- echo "  openbsd, aix51, aix52, cygwin, haiku, generic, custom"; \
+ echo "  openbsd, aix51, aix52, aix72-gcc, cygwin, haiku,
generic, custom"; \
fi
  $(Q)echo;echo "Enabled features for TARGET '$(TARGET)' (disable with
'USE_xxx=') :"
  $(Q)set -- $(foreach opt,$(patsubst USE_%,%,$(use_opts)),$(if
$(USE_$(opt)),$(opt),)); echo "  $$*" | (fmt || cat) 2>/dev/null






The patch implements a new TARGET called aix72-gcc and also adds 2
CPUs (power8 and power9). Here is my proof-of-work:




-bash-4.4$ gmake -j8 TARGET=aix72-gcc CPU=power8 USE_ZLIB=1
ZLIB_LIB=/opt/haproxy/lib ZLIB_INC=/opt/haproxy/include USE_OPENSSL=1
SSL_LIB=/opt/haproxy/lib SSL_INC=/opt/haproxy/include USE_PCRE2=1
USE_PCRE2_JIT=1 PCREDIR=/opt/haproxy USE_LUA=1
LUA_LIB=/opt/haproxy/lib LUA_INC=/opt/haproxy/include/lua
LUA_LIB_NAME=lua LUA_LD_FLAGS=
EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o"
  CC  src/ev_poll.o
  CC  src/ssl_sock.o
  CC  src/hlua.o
  CC  src/hlua_fcn.o
  CC  src/mux_h2.o
  CC  src/stream.o
  CC  src/mux_fcgi.o
  CC  src/cfgparse-listen.o
src/hlua.c: In function 'hlua_panic_ljmp':
src/hlua.c:128:1: warning: no return statement in function returning
non-void [-Wreturn-type]
 static int hlua_panic_ljmp(lua_State *L) { longjmp(safe_ljmp_env, 1); }
 ^~
  CC  src/http_ana.o
  CC  src/stats.o
  CC  src/mux_h1.o
  CC  src/flt_spoe.o
  CC  src/server.o
  CC  src/cfgparse.o
  CC  src/checks.o
  CC  src/backend.o
  CC  src/log.o
  CC  src/peers.o
  CC  src/cli.o
  CC  src/haproxy.o
  CC  src/stick_table.o
  CC  src/standard.o
  CC  src/sample.o
  CC  src/proxy.o
  CC  src/stream_interface.o
  CC  src/pattern.o
  CC  src/dns.o
  CC  src/proto_tcp.o
  CC  src/listener.o
  CC  src/cfgparse-global.o
  CC  src/h1.o
  CC  src/http_rules.o
  CC  src/http_fetch.o
  CC  src/cache.o
  CC  src/session.o
  CC  src/fcgi-app.o
  CC  src/connection.o
  CC  src/tcp_rules.o
  CC  src/filters.o
  CC  src/task.o
  CC  src/mworker.o
  CC  src/map.o
  CC  src/h1_htx.o
  CC  src/trace.o
  CC  src/flt_trace.o
  CC  src/acl.o
  CC  src/http_htx.o
  CC  src/flt_http_comp.

RE: [PATCH] AIX 7.2 support

2020-02-03 Thread Norman Branitsky
IBM is still selling AIX?!
(Which stands for: it Ain't unIX ;-) )

-Original Message-
From: Chris  
Sent: Monday, February 3, 2020 6:10 AM
To: haproxy@formilux.org
Subject: [PATCH] AIX 7.2 support

Hello everybody,

I spent some time making haproxy compile and run successfully on AIX
7.2 using GCC 8.3 and wanted to contribute my patch in the hope that it could 
be merged. The patch is based on the current haproxy 2.1 head revision. I can 
make one for the development branch too - but it should be basically identical.



--- Makefile.old 2020-02-03 10:56:25.0 +
+++ Makefile 2020-02-03 11:32:00.735254403 +
@@ -144,13 +144,13 @@
 # Use TARGET= to optimize for a specifc target OS among the  # 
following list (use the default "generic" if uncertain) :
 #linux-glibc, linux-glibc-legacy, solaris, freebsd, openbsd, netbsd,
-#cygwin, haiku, aix51, aix52, osx, generic, custom
+#cygwin, haiku, aix51, aix52, aix72-gcc, osx, generic, custom
 TARGET =

  TARGET CPU
 # Use CPU= to optimize for a particular CPU, among the following  # 
list :
-#generic, native, i586, i686, ultrasparc, custom
+#generic, native, i586, i686, ultrasparc, power8, power9, custom
 CPU = generic

  Architecture, used when not building for native architecture @@ -257,6 
+257,8 @@
 CPU_CFLAGS.i586   = -O2 -march=i586
 CPU_CFLAGS.i686   = -O2 -march=i686
 CPU_CFLAGS.ultrasparc = -O6 -mcpu=v9 -mtune=ultrasparc
+CPU_CFLAGS.power8 = -O2 -mcpu=power8 -mtune=power8
+CPU_CFLAGS.power9 = -O2 -mcpu=power9 -mtune=power9
 CPU_CFLAGS= $(CPU_CFLAGS.$(CPU))

  ARCH dependant flags, may be overridden by CPU flags @@ -381,7 +383,7 @@
   DEBUG_CFLAGS=
 endif

-# AIX 5.2 and above
+# AIX 5.2
 ifeq ($(TARGET),aix52)
   set_target_defaults = $(call default_opts, \
 USE_POLL USE_LIBCRYPT USE_OBSOLETE_LINKER) @@ -389,6 +391,14 @@
   DEBUG_CFLAGS=
 endif

+# AIX 7.2 and above
+ifeq ($(TARGET),aix72-gcc)
+  set_target_defaults = $(call default_opts, \
+USE_POLL USE_THREAD USE_LIBCRYPT USE_OBSOLETE_LINKER
USE_GETADDRINFO USE_TFO)
+  TARGET_CFLAGS   = -D_H_XMEM -D_H_VAR
+  TARGET_LDFLAGS  = -latomic
+endif
+
 # Cygwin
 ifeq ($(TARGET),cygwin)
   set_target_defaults = $(call default_opts, \ @@ -754,7 +764,7 @@
  @echo "Please choose the target among the following supported list :"
  @echo
  @echo "   linux-glibc, linux-glibc-legacy, solaris, freebsd, openbsd, netbsd,"
- @echo "   cygwin, haiku, aix51, aix52, osx, generic, custom"
+ @echo "   cygwin, haiku, aix51, aix52, aix72-gcc, osx, generic, custom"
  @echo
  @echo "Use \"generic\" if you don't want any optimization, \"custom\" if you"
  @echo "want to precisely tweak every option, or choose the target which"
@@ -832,7 +842,7 @@
else \
  echo "TARGET not set, you may pass 'TARGET=xxx' to set one among :";\
  echo "  linux-glibc, linux-glibc-legacy, solaris, freebsd, netbsd, osx,"; 
\
- echo "  openbsd, aix51, aix52, cygwin, haiku, generic, custom"; \
+ echo "  openbsd, aix51, aix52, aix72-gcc, cygwin, haiku,
generic, custom"; \
fi
  $(Q)echo;echo "Enabled features for TARGET '$(TARGET)' (disable with
'USE_xxx=') :"
  $(Q)set -- $(foreach opt,$(patsubst USE_%,%,$(use_opts)),$(if 
$(USE_$(opt)),$(opt),)); echo "  $$*" | (fmt || cat) 2>/dev/null






The patch implements a new TARGET called aix72-gcc and also adds 2 CPUs (power8 
and power9). Here is my proof-of-work:




-bash-4.4$ gmake -j8 TARGET=aix72-gcc CPU=power8 USE_ZLIB=1 
ZLIB_LIB=/opt/haproxy/lib ZLIB_INC=/opt/haproxy/include USE_OPENSSL=1 
SSL_LIB=/opt/haproxy/lib SSL_INC=/opt/haproxy/include USE_PCRE2=1
USE_PCRE2_JIT=1 PCREDIR=/opt/haproxy USE_LUA=1 LUA_LIB=/opt/haproxy/lib 
LUA_INC=/opt/haproxy/include/lua LUA_LIB_NAME=lua LUA_LD_FLAGS= 
EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o"
  CC  src/ev_poll.o
  CC  src/ssl_sock.o
  CC  src/hlua.o
  CC  src/hlua_fcn.o
  CC  src/mux_h2.o
  CC  src/stream.o
  CC  src/mux_fcgi.o
  CC  src/cfgparse-listen.o
src/hlua.c: In function 'hlua_panic_ljmp':
src/hlua.c:128:1: warning: no return statement in function returning non-void 
[-Wreturn-type]  static int hlua_panic_ljmp(lua_State *L) { 
longjmp(safe_ljmp_env, 1); }  ^~
  CC  src/http_ana.o
  CC  src/stats.o
  CC  src/mux_h1.o
  CC  src/flt_spoe.o
  CC  src/server.o
  CC  src/cfgparse.o
  CC  src/checks.o
  CC  src/backend.o
  CC  src/log.o
  CC  src/peers.o
  CC  src/cli.o
  CC  src/haproxy.o
  CC  src/stick_table.o
  CC  src/standard.o
  CC  src/sample.o
  CC  src/proxy.o
  CC  src/stream_interface.o
  CC  src/pattern.o
  CC  src/dns.o
  CC  src/proto_tcp.o
  CC  src/listener.o
  CC  src/cfgparse-global.o
  CC  src/h1.o
  CC  src/http_rules.o
  CC  src/http_fetch.o
  CC  src/cache.o
  CC  src/session.o
  CC  src/fcgi-app.o
  CC  src/connection.o
  CC  src/tcp_rules.o
  CC  src

Re: how to properly reload haproxy (from systemd + master-worker) ?

2020-02-03 Thread Ilyas Bakirov
Maybe first ExecReload command should be ExecReloadPre?

вс, 2 февр. 2020 г., 19:56 Илья Шипицин :

> Hello,
>
> I'm playing with RPM built here:
> https://copr.fedorainfracloud.org/coprs/roidelapluie/haproxy/
>
>
> it is shipped with systemd unit:
>
> ExecReload=/usr/sbin/haproxy -f $CONFIG -c -q
> ExecReload=/bin/kill -USR2 $MAINPID
>
>
> actually it works.
> however, if I add dataplane api:
>
> -
> global
>   master-worker
>
> userlist controller
>   user dataplaneapi insecure-password xxx
>
> program api
>   command dataplaneapi --host 0.0.0.0 --port  --haproxy-bin
> /usr/sbin/haproxy --config-file /etc/haproxy/haproxy.cfg --log-to=file
> --log-file=/var/log/dataplaneapi.log --log-level=trace --log-format=text
> --reload-cmd "systemctl reload haproxy" --reload-delay 5
> ---
>
>
> haproxy terminates on "systemctl reload haproxy" (which for example
> happens from within dataplaneapi).
>
> I guess, something is wrong with two above mentioned "ExecReload" commands.
> any advice how to adjust them ?
>
>
> thanks,
> Ilya Shipitcin
>


Re: how to properly reload haproxy (from systemd + master-worker) ?

2020-02-03 Thread William Lallemand
On Sun, Feb 02, 2020 at 11:23:09PM +0500, Илья Шипицин wrote:
> btw, is it possible to configure haproxy "to run either with or without
> configured program" ?
>

It's not possible.
 
> actually, I'm ok if it will start even if dataplane api failed.
> 

Well, I don't want this to happen, because we will have to handle a failure
status within for the program section, and start to develop a real process
manager. If you need complicated condition like this, I suggest you to start
the dataplane-api with your init system.


> вс, 2 февр. 2020 г. в 22:58, Tim Düsterhus :
> 
> [...]
> > > Feb 02 20:50:07 xxx systemd[1]: haproxy.service failed.
> >
> > ... leading to the unit being stopped.
> >
> > So you would have to find out with the dataplane API dies. My educated
> > guess would be that it fails because the port is already being in use by
> > the old dataplane API process.
> >

>From what I understand of the dataplaneapi, it is reloaded upon a USR1 signal,
signal which is sent by the master process upon a reload.

So you probably just need to add "no option start-on-reload" in your program
section to prevent HAProxy to launch the dataplane-api again.

-- 
William Lallemand



Re: how to properly reload haproxy (from systemd + master-worker) ?

2020-02-03 Thread Илья Шипицин
вт, 4 февр. 2020 г. в 00:20, William Lallemand :

> On Sun, Feb 02, 2020 at 11:23:09PM +0500, Илья Шипицин wrote:
> > btw, is it possible to configure haproxy "to run either with or without
> > configured program" ?
> >
>
> It's not possible.
>
> > actually, I'm ok if it will start even if dataplane api failed.
> >
>
> Well, I don't want this to happen, because we will have to handle a failure
> status within for the program section, and start to develop a real process
> manager. If you need complicated condition like this, I suggest you to
> start
> the dataplane-api with your init system.
>

I just followed some examples taken from docs.

I'm pretty ok with using systemd for starting processes. Actually, I do not
see any benefit for starting dataplane api
from haproxy itself (taking into consideration that haproxy is not real
process manager)


>
>
> > вс, 2 февр. 2020 г. в 22:58, Tim Düsterhus :
> >
> > [...]
> > > > Feb 02 20:50:07 xxx systemd[1]: haproxy.service failed.
> > >
> > > ... leading to the unit being stopped.
> > >
> > > So you would have to find out with the dataplane API dies. My educated
> > > guess would be that it fails because the port is already being in use
> by
> > > the old dataplane API process.
> > >
>
> From what I understand of the dataplaneapi, it is reloaded upon a USR1
> signal,
> signal which is sent by the master process upon a reload.
>
> So you probably just need to add "no option start-on-reload" in your
> program
> section to prevent HAProxy to launch the dataplane-api again.
>


thank you, I'll try

maybe it should be added to docs.

>
> --
> William Lallemand
>


Boost Web Standing : haproxy.com

2020-02-03 Thread Steve Evans
Hi haproxy.com Team,

Hope you are well.

Digital Marketing has become a delicate division for brand visibility.
While going through your website we observed some important elements which
can act as an eye opener for you and need to be handled elegantly to get
topmost outcome.

* Please find some of the factors mentioned below which is affecting your
website performance: *

   - Variable and unique Contents will ensure better informative site.
   - Your business is not active in diverse social media platforms.
   - Low indexing of web pages in Google Se Rps.
   - Imperfect mobile responsive site blocks viewers from several platforms.
   - Internal and external linking of your website need to be initiated.

There are many other factors which need to be sorted out. Everybody wants
to increase the traffic flow for their website or drive returns and I am
sure you are also looking for the same. Well, with a massive experienced
Team we succeeded in providing complete web assistance that yields real
time solutions.

We cover all the major factors of promotion under single umbrella starting
from error fixation, keywords ranking, online PR, Social media promotion
etc. This e-mail provides you with a glimpse of some of the services which
we offered from our company.
If you require any sort of website assistance or if you have any query
about our services then kindly contact us back.

We will be waiting for your response.






Steve Evans
*Digital Marketing Analyst*
.
[image: beacon]


Re: I have a question about your post

2020-02-03 Thread Jessica Henderson
Hey,  
 Just seeing if you had managed to check the email I sent a few days ago?  
 Thanks 
 Jessica  
 
 
 -Original Message- 
 Hey, 
 I just wanted to reach out because I've really been enjoying your content.  
 I know you get plenty of emails like this (but mine is different I promise). 
I've actually had some ideas for content that would work really well and was 
wondering if you'd be open to accepting a guest post?  
 To give you an idea of my writing style, here are two recent posts that I've 
written: 
 https://www.top10-websitehosting.co.uk/updating-node-js ( 
https://www.top10-websitehosting.co.uk/updating-node-js ) 
 https://www.top10-websitehosting.co.uk/ecommerce-conversion-rates ( 
https://www.top10-websitehosting.co.uk/ecommerce-conversion-rates ) 
 Let me know and I can send across some content suggestions (or you can even 
request a specific title).  
 Once you've confirmed a content title then I can send a draft for your review 
this week.  
 As a little extra, I'll even share the post across our social channels :) 
 Thanks 
 Jessica