Problem in plg_http_post
Problem in plg_http_post with libcurl.so.4
This issue is only on centos7.
$ bin/filenotify -c filenotify.config
Fri Feb 28 17:33:24 2020 : INFO : Config : watch_directory.1=/tmp/test3
Fri Feb 28 17:33:24 2020 : INFO : Config : watch_directory.0=/tmp/test1
Fri Feb 28 17:33:24 2020 : INFO : Config : exec2.cmd=echo "exec2 - file_status,dirname=%s,filename=%s value=%s"
Fri Feb 28 17:33:24 2020 : INFO : Config : exec1.cmd=echo "exec1 - file_status,dirname=%s,filename=%s value=%s"
Fri Feb 28 17:33:24 2020 : INFO : Config : http_post.auth=james:bond
Fri Feb 28 17:33:24 2020 : INFO : Config : http_post.data=file_status,host=localhost,dirname=%s,filename=%s value=%s
Fri Feb 28 17:33:24 2020 : INFO : Config : http_post.url=http://localhost:8086/write?db=data
Fri Feb 28 17:33:24 2020 : INFO : Config : plugins.influxdb=plg_http_post.so
Fri Feb 28 17:33:24 2020 : INFO : Config : plugins.log=plg_notify_log.so
Fri Feb 28 17:33:24 2020 : INFO : Config : plugins_dir=./bin/
Fri Feb 28 17:33:24 2020 : INFO : Config : loglevel=DEBUG
Fri Feb 28 17:33:24 2020 : INFO : Config : logfile=/home/m-sap-orp/filenotify.log
Fri Feb 28 17:33:24 2020 : INFO : Chargement du plugins : ./bin/plg_notify_log.so
Fri Feb 28 17:33:24 2020 : INFO : Chargement du plugins : ./bin/plg_http_post.so
Fri Feb 28 17:33:24 2020 : DEBUG : plg_http_post use library libcurl.so.4
Fri Feb 28 17:33:24 2020 : INFO : *** Welcome in filenotifier ***
Fri Feb 28 17:33:24 2020 : DEBUG : inotify descriptor=1 for directory /tmp/test1/
Fri Feb 28 17:33:24 2020 : INFO : Presence initiale du fichier : /tmp/test1/hello (5) (10)
Fri Feb 28 17:33:24 2020 : DEBUG : handle - plg_http_post
Fri Feb 28 17:33:24 2020 : DEBUG : POST http://localhost:8086/write?db=data, data: file_status,host=localhost,dirname=/tmp/test1,filename=hello value=1
Segmentation fault
To reproduce :
docker run -it -v /home/matgou/workspace:/workspace centos:centos8 /bin/bash -c "mkdir /tmp/test1 && touch /tmp/test1/totot && cd /workspace/filenotify && bin/filenotify -c filenotify.config"
Edited by Mathieu GOULIN