diff options
author | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2018-01-20 18:46:03 +0200 |
---|---|---|
committer | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2018-01-20 18:46:03 +0200 |
commit | 7f83aa21ae22aa051cc3572749e49b4d2c1cf1dc (patch) | |
tree | 52d1c307e7490cef12fe8135528048ba32b7bd81 /netdata-installer.sh | |
parent | 4ffeeeb69e573c31cc44e8d181ed6196b19460ec (diff) |
do not chown to root when installing as non-root
Diffstat (limited to 'netdata-installer.sh')
-rwxr-xr-x | netdata-installer.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/netdata-installer.sh b/netdata-installer.sh index 5f23e666e7..7d8e1d7136 100755 --- a/netdata-installer.sh +++ b/netdata-installer.sh @@ -678,9 +678,11 @@ if [ "${UID}" = "0" ] then NETDATA_USER="$( config_option "global" "run as user" "netdata" )" NETDATA_GROUP="${NETDATA_USER}" + ROOT_USER="root" else NETDATA_USER="${USER}" NETDATA_GROUP="$(id -g -n ${NETDATA_USER})" + ROOT_USER="${NETDATA_USER}" fi # the owners of the web files @@ -719,7 +721,7 @@ do run mkdir -p "${NETDATA_CONF_DIR}/${x}" || exit 1 fi done -run chown -R "root:${NETDATA_GROUP}" "${NETDATA_CONF_DIR}" +run chown -R "${ROOT_USER}:${NETDATA_GROUP}" "${NETDATA_CONF_DIR}" run find "${NETDATA_CONF_DIR}" -type f -exec chmod 0640 {} \; run find "${NETDATA_CONF_DIR}" -type d -exec chmod 0755 {} \; |