summaryrefslogtreecommitdiffstats
path: root/packaging/makeself/install-or-update.sh
diff options
context:
space:
mode:
authorKonstantinos Natsakis <5933427+knatsakis@users.noreply.github.com>2019-11-11 21:16:42 +0200
committerGitHub <noreply@github.com>2019-11-11 21:16:42 +0200
commit1094175c3bd08ecf5c83c91605e9fd1d02052108 (patch)
treedc09f1a67fc5b230fb294ac884a8d49ecb23d88d /packaging/makeself/install-or-update.sh
parentbe75567a7d8cbec27030fa2bb6acc66aaa852154 (diff)
Ownership and permissions of /etc/netdata (#7244)
* make install takes care of ownership and permissions of /etc/netdata Instead of netdata-installer.sh * Fix identation in Makefile.am files * netdata-installer.sh: Clearer variable assignment * netdata-installer.sh: Set /etc/netdata/netdata.conf ownership to root:root and permissions to 0644 * netdata-installer.sh: Set /etc/netdata/.environment permissions to 0644 * install-or-update.sh: Set permissions for /opt/netdata/etc/netdata.conf to 0644 * install-or-update.sh: Use ${NETDATA_PREFIX} more * install-or-update.sh: Improve indentation * install-or-update.sh: Do not create /opt/netdata/etc/netdata directories * debian/rules: /etc/netdata files and directories are now installed by make install * debian/rules: Properly copy files across directories When destination directory exists * netdata.spec.in: /etc/netdata ownership and permissions * Revert "Fix identation in Makefile.am files" This reverts commit 63fdb299b69152fda6984f81b0fef02f364c5efe. * Remove uninstall-local recipes from Makefile.am files * Removed superfluous whitespace and hash
Diffstat (limited to 'packaging/makeself/install-or-update.sh')
-rwxr-xr-xpackaging/makeself/install-or-update.sh39
1 files changed, 12 insertions, 27 deletions
diff --git a/packaging/makeself/install-or-update.sh b/packaging/makeself/install-or-update.sh
index 76f7c99212..7733d007ae 100755
--- a/packaging/makeself/install-or-update.sh
+++ b/packaging/makeself/install-or-update.sh
@@ -201,19 +201,6 @@ fi
# -----------------------------------------------------------------------------
-
-progress "create user config directories"
-
-for x in "python.d" "charts.d" "node.d" "health.d" "statsd.d" "custom-plugins.d" "ssl"
-do
- if [ ! -d "etc/netdata/${x}" ]
- then
- run mkdir -p "etc/netdata/${x}" || exit 1
- fi
-done
-
-
-# -----------------------------------------------------------------------------
progress "fix permissions"
run chmod g+rx,o+rx /opt
@@ -244,20 +231,18 @@ fi
# -----------------------------------------------------------------------------
-
if [ ${STARTIT} -eq 0 ]; then
- create_netdata_conf "/opt/netdata/etc/netdata/netdata.conf"
- netdata_banner "is installed now!"
+ create_netdata_conf "${NETDATA_PREFIX}/etc/netdata/netdata.conf"
+ netdata_banner "is installed now!"
else
- progress "starting netdata"
-
- if ! restart_netdata "/opt/netdata/bin/netdata"; then
- create_netdata_conf "/opt/netdata/etc/netdata/netdata.conf"
- netdata_banner "is installed and running now!"
- else
- create_netdata_conf "/opt/netdata/etc/netdata/netdata.conf" "http://localhost:19999/netdata.conf"
- netdata_banner "is installed now!"
- fi
+ progress "starting netdata"
+
+ if ! restart_netdata "${NETDATA_PREFIX}/bin/netdata"; then
+ create_netdata_conf "${NETDATA_PREFIX}/etc/netdata/netdata.conf"
+ netdata_banner "is installed and running now!"
+ else
+ create_netdata_conf "${NETDATA_PREFIX}/etc/netdata/netdata.conf" "http://localhost:19999/netdata.conf"
+ netdata_banner "is installed now!"
+ fi
fi
-run chown "${NETDATA_USER}:${NETDATA_GROUP}" "/opt/netdata/etc/netdata/netdata.conf"
-run chmod 0664 "/opt/netdata/etc/netdata/netdata.conf"
+run chmod 0644 "${NETDATA_PREFIX}/etc/netdata/netdata.conf"