diff --git a/testing/haproxy-dataplaneapi/APKBUILD b/testing/haproxy-dataplaneapi/APKBUILD index 861b0bbe855..ae7c06838cd 100644 --- a/testing/haproxy-dataplaneapi/APKBUILD +++ b/testing/haproxy-dataplaneapi/APKBUILD @@ -3,7 +3,7 @@ pkgname=haproxy-dataplaneapi _pkgname=dataplaneapi pkgver=2.9.5 -pkgrel=0 +pkgrel=1 pkgdesc="HAProxy data plane API" url="https://github.com/haproxytech/dataplaneapi" arch="all" @@ -49,7 +49,7 @@ package() { sha512sums=" 90d03ae28f1206c8989bfbbd1b5a88ac6debcb962a974f1caa3000df149c12a17d6cfa4a9f8715c75035e94685fbce5a6bb9c3f87c26d9378437f335ec8fec90 dataplaneapi-2.9.5.tar.gz -e38d0566e19a0c664c78c86e5e90986e7cda214c0c306ad9095bf3d0e28a3f84ec4afcca237c961b0ccdca13679b66fe8c6fc24007c8506fd2fc5553e01122f8 haproxy-dataplaneapi.initd -aa9373b5c3f44ffacad77ef075fc196d944c893a044e6a79d58125ac7b4b7c8c90c4c8c70dd69ba884e56752382221af5e9968d6c9241f6740b20bb5294bfd77 haproxy-dataplaneapi.confd -368c6877f79a53f597e34f91029e9c4c8fa141046d284b0a79a641e09ad32072ab9cc2ae691f173786557fc220cf0fc7b6ec0eecc41d20fd2bcff689a56cf185 dataplaneapi.yml +29f0f6f489f0b163eae7945bd53c663f95c608aeadc2437545933020b33357f019f0bb50840ea88ff80e645b2082210fef9590ff2013d5b49c60e2c3d85e81ad haproxy-dataplaneapi.initd +76c173820d513de762e6834ad3dcaf53695d2a8f6bb2340c0a50be769fdb9abd1a63a254d5ea4a51bcf8d7a8edd1d9b531aa73974cffbed5d95be05e111b2211 haproxy-dataplaneapi.confd +95b843518ecc90c0bf052982c12a4de5f2b3d2d98fc831a85ad22508ba25b01739e1d3cd8318c22369771dad765f2e45059cb5094b8456be6bbc084bff3136be dataplaneapi.yml " diff --git a/testing/haproxy-dataplaneapi/dataplaneapi.yml b/testing/haproxy-dataplaneapi/dataplaneapi.yml index 49b67eb4552..34bb2462eb8 100644 --- a/testing/haproxy-dataplaneapi/dataplaneapi.yml +++ b/testing/haproxy-dataplaneapi/dataplaneapi.yml @@ -24,3 +24,14 @@ haproxy: reload_cmd: service haproxy reload restart_cmd: service haproxy restart reload_strategy: custom +log_targets: +- log_to: file + log_file: /var/log/dataplaneapi/app.log + log_level: info + log_types: + - app +- log_to: file + log_file: /var/log/dataplaneapi/access.log + log_level: info + log_types: + - access diff --git a/testing/haproxy-dataplaneapi/haproxy-dataplaneapi.confd b/testing/haproxy-dataplaneapi/haproxy-dataplaneapi.confd index 30410d9d0be..6f77932dd4d 100755 --- a/testing/haproxy-dataplaneapi/haproxy-dataplaneapi.confd +++ b/testing/haproxy-dataplaneapi/haproxy-dataplaneapi.confd @@ -2,5 +2,11 @@ CONFIGFILE=/etc/haproxy/dataplaneapi.yml +# dataplaneapi should be able to restart haproxy service, so by default it runs +# as root. However if your system is running haproxy with a process manager +# that doesn't require root privilege to be operated, then you should run it as +# a non-privileged user. +#command_user="haproxy:haproxy" + # Comment out to disable process supervisor. supervisor=supervise-daemon diff --git a/testing/haproxy-dataplaneapi/haproxy-dataplaneapi.initd b/testing/haproxy-dataplaneapi/haproxy-dataplaneapi.initd index cf2a598c71b..61e52d15793 100755 --- a/testing/haproxy-dataplaneapi/haproxy-dataplaneapi.initd +++ b/testing/haproxy-dataplaneapi/haproxy-dataplaneapi.initd @@ -3,13 +3,19 @@ name="haproxy-dataplaneapi" description="HAProxy Data Plane API" +: ${command_user="root:root"} + pidfile="/run/$RC_SVCNAME.pid" command="/usr/sbin/dataplaneapi" command_args="-f $CONFIGFILE" command_background="yes" -command_user="haproxy:haproxy" depend() { need net after firewall } + +start_pre() { + checkpath -d --owner "$command_user" --mode 0755 \ + /var/log/dataplaneapi +}