diff options
author | Austin S. Hemmelgarn <austin@netdata.cloud> | 2020-01-24 07:19:40 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-24 07:19:40 -0500 |
commit | de9a08df6cc8f8a9ec381564599ad0c8d3f4e352 (patch) | |
tree | 4832d74780117c6081c27331e788d224f61fcfbd /netdata-installer.sh | |
parent | f1d133190bda44504a7f55834ec626ab4e3d32ee (diff) |
Fix install permissions (#7632)
* Fix ownership and permissions in RPM packages.
This restructures things so that we're relying as much as possible on
the `make install` command, which gets the ownership and permissions
right in most cases.
It does not change any of the capabilities afforded to various commands,
those need further investigation to be set correctly.
* Use correct perms and owners in installer script.
This corrects the permissions and ownership of files as installed
through the regular installer script (used for kickstart.sh installs).
Diffstat (limited to 'netdata-installer.sh')
-rwxr-xr-x | netdata-installer.sh | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/netdata-installer.sh b/netdata-installer.sh index 8dcb3996f7..51dff92ee3 100755 --- a/netdata-installer.sh +++ b/netdata-installer.sh @@ -681,9 +681,6 @@ for link in "orig" "${helplink}"; do run ln -s "${NETDATA_STOCK_CONFIG_DIR}" "${NETDATA_USER_CONFIG_DIR}/${link}" fi done -run chown -R "${ROOT_USER}:${NETDATA_GROUP}" "${NETDATA_STOCK_CONFIG_DIR}" -run find "${NETDATA_STOCK_CONFIG_DIR}" -type f -exec chmod 0640 {} \; -run find "${NETDATA_STOCK_CONFIG_DIR}" -type d -exec chmod 0755 {} \; # --- web dir ---- @@ -729,7 +726,7 @@ if [ "${UID}" -eq 0 ]; then test -z "${admin_group}" && admin_group="${NETDATA_GROUP}" run chown "${NETDATA_USER}:${admin_group}" "${NETDATA_LOG_DIR}" - run chown -R "root:${NETDATA_GROUP}" "${NETDATA_PREFIX}/usr/libexec/netdata" + run chown -R "root:${admin_group}" "${NETDATA_PREFIX}/usr/libexec/netdata" run find "${NETDATA_PREFIX}/usr/libexec/netdata" -type d -exec chmod 0755 {} \; run find "${NETDATA_PREFIX}/usr/libexec/netdata" -type f -exec chmod 0644 {} \; run find "${NETDATA_PREFIX}/usr/libexec/netdata" -type f -a -name \*.plugin -exec chmod 0750 {} \; @@ -789,7 +786,7 @@ if [ "${UID}" -eq 0 ]; then if [ -f "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/cgroup-network-helper.sh" ]; then run chown "root:${NETDATA_GROUP}" "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/cgroup-network-helper.sh" - run chmod 0550 "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/cgroup-network-helper.sh" + run chmod 0750 "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/cgroup-network-helper.sh" fi else @@ -871,7 +868,7 @@ install_go() { run rm -rf "${NETDATA_STOCK_CONFIG_DIR}/go.d" run rm -rf "${NETDATA_STOCK_CONFIG_DIR}/go.d.conf" run tar -xf "${tmp}/config.tar.gz" -C "${NETDATA_STOCK_CONFIG_DIR}/" - run chown -R "${ROOT_USER}:${NETDATA_GROUP}" "${NETDATA_STOCK_CONFIG_DIR}" + run chown -R "${ROOT_USER}:${ROOT_GROUP}" "${NETDATA_STOCK_CONFIG_DIR}" run tar xf "${tmp}/${GO_PACKAGE_BASENAME}" run mv "${GO_PACKAGE_BASENAME/\.tar\.gz/}" "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/go.d.plugin" |