Re: how to write to a file safely in haproxy

2021-06-23 Thread reshma r
Hello sorry for the late reply. This was really helpful! Thanks a lot On Fri, 11 Jun 2021, 11:43 Willy Tarreau, wrote: > Hello, > > On Fri, Jun 11, 2021 at 11:38:38AM +0530, reshma r wrote: > > Hello all, > > I Had a follow up query, sorry if it is an obvious question. once I > > implement the s

Re: how to write to a file safely in haproxy

2021-06-10 Thread Willy Tarreau
Hello, On Fri, Jun 11, 2021 at 11:38:38AM +0530, reshma r wrote: > Hello all, > I Had a follow up query, sorry if it is an obvious question. once I > implement the socket call as a sidecar process, say as a lua script that > reads the new configuration from portal into a variable, how would I then

Re: how to write to a file safely in haproxy

2021-06-10 Thread reshma r
Hello all, I Had a follow up query, sorry if it is an obvious question. once I implement the socket call as a sidecar process, say as a lua script that reads the new configuration from portal into a variable, how would I then update this variable within haproxy to be used by lua script loaded using

Re: how to write to a file safely in haproxy

2021-05-27 Thread reshma r
Hi, thank you for the detailed and informative reply! It definitely helped clarify things. Indeed I had disabled chroot to read the files at runtime, but have since switched to read during init phase . Thank you for the tips on the architecture aspect as well. I will study and explore these options

Re: how to write to a file safely in haproxy

2021-05-26 Thread Willy Tarreau
Hi, On Wed, May 26, 2021 at 10:43:17PM +0530, reshma r wrote: > Hi Tim thanks a lot for the reply. I am not familiar with what a sidecar > process is. I will look into it. If it is specific to haproxy, if you could > point to some relevant documentation that would be helpful. It's not specific to

Re: how to write to a file safely in haproxy

2021-05-26 Thread reshma r
Hi Tim thanks a lot for the reply. I am not familiar with what a sidecar process is. I will look into it. If it is specific to haproxy, if you could point to some relevant documentation that would be helpful. >I am making a > socket call which periodically checks whether the portal has been change

Re: how to write to a file safely in haproxy

2021-05-26 Thread Tim Düsterhus
Reshma, On 5/26/21 4:44 PM, reshma r wrote: not). There is a requirement that the configuration file may be changed from an external portal. So whenever a change is made in the portal I would like to update my configuration file accordingly. To do this, I am making a socket call which periodical

Re: how to write to a file safely in haproxy

2021-05-26 Thread reshma r
Also the configuration file I was referring to in the previous email is not the haproxy config. it is a different file that contains some json configs. Sorry for the confusion. On Wed, May 26, 2021 at 8:14 PM reshma r wrote: > Hi, thank you for the quick response > @Chipitsine This is where I re

Re: how to write to a file safely in haproxy

2021-05-26 Thread reshma r
Hi, thank you for the quick response @Chipitsine This is where I read the recommendation: https://www.haproxy.com/blog/5-ways-to-extend-haproxy-with-lua/ - (search for register_init in this). @Lukas >> Are you talking about writing to the filesystem from a LUA scripts or other runtime code within

Re: how to write to a file safely in haproxy

2021-05-26 Thread Lukas Tribus
Hello, On Wed, 26 May 2021 at 13:29, reshma r wrote: > > Hello all, > Periodically I need to write some configuration data to a file. > However I came across documentation that warned against writing to a file at > runtime. > Can someone give me advice on how I can achieve this safely? You'll h

Re: how to write to a file safely in haproxy

2021-05-26 Thread Илья Шипицин
Not clear what recommendation did you read. you might consider dataplane api for config management: haproxytech/dataplaneapi: HAProxy Data Plane API (github.com) On Wed, May 26, 2021, 4:32 PM reshma r wrote: > Hello all, > Periodically I need to writ

how to write to a file safely in haproxy

2021-05-26 Thread reshma r
Hello all, Periodically I need to write some configuration data to a file. However I came across documentation that warned against writing to a file at runtime. Can someone give me advice on how I can achieve this safely? Appreciate any help Thank you