diff --git a/zabbix-agent2/Dockerfile b/zabbix-agent2/Dockerfile index bb10918..2bb55e6 100644 --- a/zabbix-agent2/Dockerfile +++ b/zabbix-agent2/Dockerfile @@ -7,7 +7,7 @@ FROM ${BUILD_BASE_IMAGE} AS builder # FROM $BUILD_FROM # FROM alpine:3.19 -FROM ghcr.io/home-assistant/amd64-base:3.18 +FROM ghcr.io/hassio-addons/base:16.1.0 ARG MAJOR_VERSION ARG ZBX_VERSION @@ -64,8 +64,8 @@ RUN set -eux && \ chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ && \ chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \ chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \ - # chmod a+x /etc/services.d/zabbix_agent2/run && \ - # chmod a+x /etc/services.d/zabbix_agent2/finish + chmod a+x /etc/services.d/zabbix_agent2/run && \ + chmod a+x /etc/services.d/zabbix_agent2/finish && \ chmod a+x /run.sh EXPOSE 10050/TCP 31999/TCP @@ -80,4 +80,5 @@ WORKDIR /var/lib/zabbix USER 1997 # CMD ["/usr/sbin/zabbix_agent2", "--foreground", "-c", "/config/zabbix_agent2.conf"] -CMD [ "/run.sh" ] +ENTRYPOINT [] +CMD ["/run.sh"] diff --git a/zabbix-agent2/config.yaml b/zabbix-agent2/config.yaml index f55fad6..a73c2ab 100644 --- a/zabbix-agent2/config.yaml +++ b/zabbix-agent2/config.yaml @@ -12,7 +12,8 @@ arch: - i386 startup: system boot: auto -init: true +# init: true +apparmor: false full_access: true host_ipc: true host_pid: true diff --git a/zabbix-agent2/rootfs/etc/services.d/zabbix_agent2/run b/zabbix-agent2/rootfs/etc/services.d/zabbix_agent2/run index bf3a5aa..728a0b0 100644 --- a/zabbix-agent2/rootfs/etc/services.d/zabbix_agent2/run +++ b/zabbix-agent2/rootfs/etc/services.d/zabbix_agent2/run @@ -4,7 +4,7 @@ # Home Assistant Add-on: Zabbix agent 2 # Runs zabbix agent 2 # ============================================================================== - +declare -a options readonly ZBX_CFG_FILE='/config/zabbix_agent2.conf' bashio::log.info 'Starting zabbix-agent2...' @@ -14,5 +14,7 @@ if ! bashio::fs.file_exists "${ZBX_CFG_FILE}" || [ -z "$(ls -A ${ZBX_CFG_FILE})" cp /etc/zabbix/zabbix_agent2.conf ${ZBX_CFG_FILE} fi -# Run zabbix-agent2 in foreground -zabbix_agent2 --foreground -c /config/zabbix_agent2.conf +options+=(--foreground) +options+=(-c /config/zabbix_agent2.conf) + +exec zabbix_agent2 "${options[@]}"