Allow to start Zabbix processes under root and other users

This commit is contained in:
Alexey Pustovalov
2019-10-03 20:52:14 +03:00
parent 7fb5abe44f
commit 7b5b22da8f
13 changed files with 46 additions and 9 deletions

View File

@ -10,9 +10,10 @@ LABEL org.opencontainers.image.title="Zabbix proxy (SQLite3)" \
STOPSIGNAL SIGTERM
RUN set -eux && \
addgroup zabbix && \
addgroup -S -g 1000 zabbix && \
adduser -S \
-D -G zabbix \
-u 999 \
-h /var/lib/zabbix/ \
zabbix && \
mkdir -p /etc/zabbix && \

View File

@ -225,6 +225,12 @@ update_zbx_config() {
update_config_var $ZBX_CONFIG "TLSPSKIdentity" "${ZBX_TLSPSKIDENTITY}"
update_config_var $ZBX_CONFIG "TLSPSKFile" "${ZBX_TLSPSKFILE}"
if [ "$(id -u)" != '0' ]; then
update_config_var $ZBX_CONFIG "User" "$(whoami)"
else
update_config_var $ZBX_CONFIG "AllowRoot" "1"
fi
}
prepare_proxy() {