summaryrefslogtreecommitdiffstats
path: root/packaging/cmake/pkg-files/deb
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xpackaging/cmake/pkg-files/deb/ebpf-code-legacy/postinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/ebpf-code-legacy/preinst11
-rw-r--r--packaging/cmake/pkg-files/deb/netdata/conffiles (renamed from contrib/debian/conffiles)0
-rw-r--r--packaging/cmake/pkg-files/deb/netdata/etc/default/netdata (renamed from contrib/debian/netdata.default)0
-rwxr-xr-xpackaging/cmake/pkg-files/deb/netdata/etc/init.d/netdata (renamed from contrib/debian/netdata.init)0
-rwxr-xr-xpackaging/cmake/pkg-files/deb/netdata/postinst53
-rwxr-xr-xpackaging/cmake/pkg-files/deb/netdata/postrm55
-rwxr-xr-xpackaging/cmake/pkg-files/deb/netdata/preinst26
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-apps/postinst15
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-apps/preinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-chartsd/postinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-chartsd/preinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-cups/postinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-cups/preinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-debugfs/postinst15
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-debugfs/preinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-ebpf/postinst12
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-ebpf/preinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-freeipmi/postinst12
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-freeipmi/preinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-go/postinst15
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-go/preinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-logs-management/postinst15
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-logs-management/preinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-network-viewer/postinst15
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-network-viewer/preinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-nfacct/postinst12
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-nfacct/preinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-perf/postinst18
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-perf/preinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-pythond/postinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-pythond/preinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-slabinfo/postinst15
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-slabinfo/preinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-systemd-journal/postinst15
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-systemd-journal/preinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-xenstat/postinst12
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-xenstat/preinst11
38 files changed, 525 insertions, 0 deletions
diff --git a/packaging/cmake/pkg-files/deb/ebpf-code-legacy/postinst b/packaging/cmake/pkg-files/deb/ebpf-code-legacy/postinst
new file mode 100755
index 000000000..d6fe86723
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/ebpf-code-legacy/postinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ grep /usr/libexec/netdata /var/lib/dpkg/info/netdata-ebpf-code-legacy.list | xargs -n 30 chown root:netdata
+ ;;
+esac
+
+exit 0
diff --git a/packaging/cmake/pkg-files/deb/ebpf-code-legacy/preinst b/packaging/cmake/pkg-files/deb/ebpf-code-legacy/preinst
new file mode 100755
index 000000000..57615ec06
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/ebpf-code-legacy/preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+ ;;
+esac
diff --git a/contrib/debian/conffiles b/packaging/cmake/pkg-files/deb/netdata/conffiles
index 1ec902547..1ec902547 100644
--- a/contrib/debian/conffiles
+++ b/packaging/cmake/pkg-files/deb/netdata/conffiles
diff --git a/contrib/debian/netdata.default b/packaging/cmake/pkg-files/deb/netdata/etc/default/netdata
index 0bc847fe7..0bc847fe7 100644
--- a/contrib/debian/netdata.default
+++ b/packaging/cmake/pkg-files/deb/netdata/etc/default/netdata
diff --git a/contrib/debian/netdata.init b/packaging/cmake/pkg-files/deb/netdata/etc/init.d/netdata
index c2706caa5..c2706caa5 100755
--- a/contrib/debian/netdata.init
+++ b/packaging/cmake/pkg-files/deb/netdata/etc/init.d/netdata
diff --git a/packaging/cmake/pkg-files/deb/netdata/postinst b/packaging/cmake/pkg-files/deb/netdata/postinst
new file mode 100755
index 000000000..97593c23b
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/netdata/postinst
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ if ! dpkg-statoverride --list /var/lib/netdata > /dev/null 2>&1; then
+ dpkg-statoverride --update --add netdata netdata 0755 /var/lib/netdata
+ fi
+
+ if ! dpkg-statoverride --list /var/cache/netdata > /dev/null 2>&1; then
+ dpkg-statoverride --update --add netdata netdata 0755 /var/cache/netdata
+ fi
+
+ if ! dpkg-statoverride --list /var/run/netdata > /dev/null 2>&1; then
+ dpkg-statoverride --update --add netdata netdata 0755 /var/run/netdata
+ fi
+
+ if ! dpkg-statoverride --list /var/log/netdata > /dev/null 2>&1; then
+ dpkg-statoverride --update --add netdata adm 02750 /var/log/netdata
+ fi
+
+ if ! dpkg-statoverride --list /usr/share/netdata/www > /dev/null 2>&1; then
+ dpkg-statoverride --update --add root netdata 0755 /usr/share/netdata/www
+ fi
+
+ dpkg-statoverride --force --update --add root netdata 0775 /var/lib/netdata/registry > /dev/null 2>&1
+
+ grep /usr/libexec/netdata /var/lib/dpkg/info/netdata.list | xargs -n 30 chown root:netdata
+
+ for f in ndsudo cgroup-network local-listeners ioping.plugin; do
+ chmod 4750 "/usr/libexec/netdata/plugins.d/${f}" || true
+ done
+
+ ;;
+esac
+
+if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
+ deb-systemd-helper unmask 'netdata.service' >/dev/null || true
+
+ if deb-systemd-helper --quiet was-enabled 'netdata.service'; then
+ deb-systemd-helper enable 'netdata.service' >/dev/null || true
+ else
+ deb-systemd-helper update-state 'netdata.service' >/dev/null || true
+ fi
+
+ if [ -z "${DPKG_ROOT:-}" ] && [ -d /run/systemd/system ]; then
+ systemctl --system daemon-reload >/dev/null || true
+ deb-systemd-invoke restart 'netdata.service' >/dev/null || true
+ fi
+fi
+
+exit 0
diff --git a/packaging/cmake/pkg-files/deb/netdata/postrm b/packaging/cmake/pkg-files/deb/netdata/postrm
new file mode 100755
index 000000000..7a636863b
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/netdata/postrm
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ remove) ;;
+
+ purge)
+ if dpkg-statoverride --list | grep -qw /var/cache/netdata; then
+ dpkg-statoverride --remove /var/cache/netdata
+ fi
+
+ if dpkg-statoverride --list | grep -qw /var/lib/netdata/www; then
+ dpkg-statoverride --remove /var/lib/netdata/www
+ fi
+
+ if dpkg-statoverride --list | grep -qw /usr/share/netdata/www; then
+ dpkg-statoverride --remove /usr/share/netdata/www
+ fi
+
+ if dpkg-statoverride --list | grep -qw /var/lib/netdata/registry; then
+ dpkg-statoverride --remove /var/lib/netdata/registry
+ fi
+
+ if dpkg-statoverride --list | grep -qw /var/lib/netdata; then
+ dpkg-statoverride --remove /var/lib/netdata
+ fi
+
+ if dpkg-statoverride --list | grep -qw /var/run/netdata; then
+ dpkg-statoverride --remove /var/run/netdata
+ fi
+
+ if dpkg-statoverride --list | grep -qw /var/log/netdata; then
+ dpkg-statoverride --remove /var/log/netdata
+ fi
+ ;;
+
+ *) ;;
+
+esac
+
+if [ "$1" = "remove" ]; then
+ if [ -x "/usr/bin/deb-systemd-helper" ]; then
+ deb-systemd-helper mask 'netdata.service' >/dev/null || true
+ fi
+fi
+
+if [ "$1" = "purge" ]; then
+ if [ -x "/usr/bin/deb-systemd-helper" ]; then
+ deb-systemd-helper purge 'netdata.service' >/dev/null || true
+ deb-systemd-helper unmask 'netdata.service' >/dev/null || true
+ fi
+fi
+
+exit 0
diff --git a/packaging/cmake/pkg-files/deb/netdata/preinst b/packaging/cmake/pkg-files/deb/netdata/preinst
new file mode 100755
index 000000000..6dcf201d6
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/netdata/preinst
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+
+ if ! getent passwd netdata > /dev/null; then
+ adduser --quiet --system --ingroup netdata --home /var/lib/netdata --no-create-home netdata
+ fi
+
+ for item in docker nginx varnish haproxy adm nsd proxy squid ceph nobody I2C; do
+ if getent group $item > /dev/null 2>&1; then
+ usermod -a -G $item netdata
+ fi
+ done
+ # Netdata must be able to read /etc/pve/qemu-server/* and /etc/pve/lxc/*
+ # for reading VMs/containers names, CPU and memory limits on Proxmox.
+ if [ -d "/etc/pve" ] && getent group "www-data" > /dev/null 2>&1; then
+ usermod -a -G www-data netdata
+ fi
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/plugin-apps/postinst b/packaging/cmake/pkg-files/deb/plugin-apps/postinst
new file mode 100755
index 000000000..f4621e595
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-apps/postinst
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ chown root:netdata /usr/libexec/netdata/plugins.d/apps.plugin
+ chmod 0750 /usr/libexec/netdata/plugins.d/apps.plugin
+ if ! setcap "cap_dac_read_search=eip cap_sys_ptrace=eip" /usr/libexec/netdata/plugins.d/apps.plugin; then
+ chmod -f 4750 /usr/libexec/netdata/plugins.d/apps.plugin
+ fi
+ ;;
+esac
+
+exit 0
diff --git a/packaging/cmake/pkg-files/deb/plugin-apps/preinst b/packaging/cmake/pkg-files/deb/plugin-apps/preinst
new file mode 100755
index 000000000..57615ec06
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-apps/preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/plugin-chartsd/postinst b/packaging/cmake/pkg-files/deb/plugin-chartsd/postinst
new file mode 100755
index 000000000..eddb51894
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-chartsd/postinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ grep /usr/libexec/netdata /var/lib/dpkg/info/netdata-plugin-chartsd.list | xargs -n 30 chown root:netdata
+ ;;
+esac
+
+exit 0
diff --git a/packaging/cmake/pkg-files/deb/plugin-chartsd/preinst b/packaging/cmake/pkg-files/deb/plugin-chartsd/preinst
new file mode 100755
index 000000000..57615ec06
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-chartsd/preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/plugin-cups/postinst b/packaging/cmake/pkg-files/deb/plugin-cups/postinst
new file mode 100755
index 000000000..2490a4729
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-cups/postinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ chown root:netdata /usr/libexec/netdata/plugins.d/cups.plugin
+ ;;
+esac
+
+exit 0
diff --git a/packaging/cmake/pkg-files/deb/plugin-cups/preinst b/packaging/cmake/pkg-files/deb/plugin-cups/preinst
new file mode 100755
index 000000000..57615ec06
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-cups/preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/plugin-debugfs/postinst b/packaging/cmake/pkg-files/deb/plugin-debugfs/postinst
new file mode 100755
index 000000000..e07ed60ff
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-debugfs/postinst
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ chown root:netdata /usr/libexec/netdata/plugins.d/debugfs.plugin
+ chmod 0750 /usr/libexec/netdata/plugins.d/debugfs.plugin
+ if ! setcap "cap_dac_read_search=eip" /usr/libexec/netdata/plugins.d/debugfs.plugin; then
+ chmod -f 4750 /usr/libexec/netdata/plugins.d/debugfs.plugin
+ fi
+ ;;
+esac
+
+exit 0
diff --git a/packaging/cmake/pkg-files/deb/plugin-debugfs/preinst b/packaging/cmake/pkg-files/deb/plugin-debugfs/preinst
new file mode 100755
index 000000000..57615ec06
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-debugfs/preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/plugin-ebpf/postinst b/packaging/cmake/pkg-files/deb/plugin-ebpf/postinst
new file mode 100755
index 000000000..767702282
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-ebpf/postinst
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ grep /usr/libexec/netdata /var/lib/dpkg/info/netdata-plugin-ebpf.list | xargs -n 30 chown root:netdata
+ chmod -f 4750 /usr/libexec/netdata/plugins.d/ebpf.plugin
+ ;;
+esac
+
+exit 0
diff --git a/packaging/cmake/pkg-files/deb/plugin-ebpf/preinst b/packaging/cmake/pkg-files/deb/plugin-ebpf/preinst
new file mode 100755
index 000000000..57615ec06
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-ebpf/preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/plugin-freeipmi/postinst b/packaging/cmake/pkg-files/deb/plugin-freeipmi/postinst
new file mode 100755
index 000000000..956c9c0de
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-freeipmi/postinst
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ chown root:netdata /usr/libexec/netdata/plugins.d/freeipmi.plugin
+ chmod -f 4750 /usr/libexec/netdata/plugins.d/freeipmi.plugin
+ ;;
+esac
+
+exit 0
diff --git a/packaging/cmake/pkg-files/deb/plugin-freeipmi/preinst b/packaging/cmake/pkg-files/deb/plugin-freeipmi/preinst
new file mode 100755
index 000000000..57615ec06
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-freeipmi/preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/plugin-go/postinst b/packaging/cmake/pkg-files/deb/plugin-go/postinst
new file mode 100755
index 000000000..2b60067ad
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-go/postinst
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ chown root:netdata /usr/libexec/netdata/plugins.d/go.d.plugin
+ chmod 0750 /usr/libexec/netdata/plugins.d/go.d.plugin
+ if ! setcap "cap_dac_read_search+epi cap_net_admin=eip cap_net_raw=eip" /usr/libexec/netdata/plugins.d/go.d.plugin; then
+ chmod -f 4750 /usr/libexec/netdata/plugins.d/go.d.plugin
+ fi
+ ;;
+esac
+
+exit 0
diff --git a/packaging/cmake/pkg-files/deb/plugin-go/preinst b/packaging/cmake/pkg-files/deb/plugin-go/preinst
new file mode 100755
index 000000000..57615ec06
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-go/preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/plugin-logs-management/postinst b/packaging/cmake/pkg-files/deb/plugin-logs-management/postinst
new file mode 100755
index 000000000..994b2caac
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-logs-management/postinst
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ grep /usr/libexec/netdata /var/lib/dpkg/info/netdata-plugin-logs-management.list | xargs -n 30 chown root:netdata
+ chmod 0750 /usr/libexec/netdata/plugins.d/logs-management.plugin
+ if ! setcap "cap_dac_read_search=eip cap_syslog=eip" /usr/libexec/netdata/plugins.d/logs-management.plugin; then
+ chmod -f 4750 /usr/libexec/netdata/plugins.d/logs-management.plugin
+ fi
+ ;;
+esac
+
+exit 0
diff --git a/packaging/cmake/pkg-files/deb/plugin-logs-management/preinst b/packaging/cmake/pkg-files/deb/plugin-logs-management/preinst
new file mode 100755
index 000000000..57615ec06
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-logs-management/preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/plugin-network-viewer/postinst b/packaging/cmake/pkg-files/deb/plugin-network-viewer/postinst
new file mode 100755
index 000000000..a388ded91
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-network-viewer/postinst
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ chown root:netdata /usr/libexec/netdata/plugins.d/network-viewer.plugin
+ chmod 0750 /usr/libexec/netdata/plugins.d/network-viewer.plugin
+ if ! setcap "cap_dac_read_search,cap_sys_admin,cap_sys_ptrace=eip" /usr/libexec/netdata/plugins.d/network-viewer.plugin; then
+ chmod -f 4750 /usr/libexec/netdata/plugins.d/network-viewer.plugin
+ fi
+ ;;
+esac
+
+exit 0
diff --git a/packaging/cmake/pkg-files/deb/plugin-network-viewer/preinst b/packaging/cmake/pkg-files/deb/plugin-network-viewer/preinst
new file mode 100755
index 000000000..57615ec06
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-network-viewer/preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/plugin-nfacct/postinst b/packaging/cmake/pkg-files/deb/plugin-nfacct/postinst
new file mode 100755
index 000000000..d3c8e0d25
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-nfacct/postinst
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ chown root:netdata /usr/libexec/netdata/plugins.d/nfacct.plugin
+ chmod -f 4750 /usr/libexec/netdata/plugins.d/nfacct.plugin
+ ;;
+esac
+
+exit 0
diff --git a/packaging/cmake/pkg-files/deb/plugin-nfacct/preinst b/packaging/cmake/pkg-files/deb/plugin-nfacct/preinst
new file mode 100755
index 000000000..57615ec06
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-nfacct/preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/plugin-perf/postinst b/packaging/cmake/pkg-files/deb/plugin-perf/postinst
new file mode 100755
index 000000000..f39d443fc
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-perf/postinst
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ chown root:netdata /usr/libexec/netdata/plugins.d/perf.plugin
+ chmod 0750 /usr/libexec/netdata/plugins.d/perf.plugin
+
+ if ! setcap cap_perfmon+ep /usr/libexec/netdata/plugins.d/perf.plugin 2>/dev/null; then
+ if ! setcap cap_sys_admin+ep /usr/libexec/netdata/plugins.d/perf.plugin 2>/dev/null; then
+ chmod -f 4750 /usr/libexec/netdata/plugins.d/perf.plugin
+ fi
+ fi
+ ;;
+esac
+
+exit 0
diff --git a/packaging/cmake/pkg-files/deb/plugin-perf/preinst b/packaging/cmake/pkg-files/deb/plugin-perf/preinst
new file mode 100755
index 000000000..57615ec06
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-perf/preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/plugin-pythond/postinst b/packaging/cmake/pkg-files/deb/plugin-pythond/postinst
new file mode 100755
index 000000000..5a8e8c694
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-pythond/postinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ grep /usr/libexec/netdata /var/lib/dpkg/info/netdata-plugin-pythond.list | xargs -n 30 chown root:netdata
+ ;;
+esac
+
+exit 0
diff --git a/packaging/cmake/pkg-files/deb/plugin-pythond/preinst b/packaging/cmake/pkg-files/deb/plugin-pythond/preinst
new file mode 100755
index 000000000..57615ec06
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-pythond/preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/plugin-slabinfo/postinst b/packaging/cmake/pkg-files/deb/plugin-slabinfo/postinst
new file mode 100755
index 000000000..149764469
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-slabinfo/postinst
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ chown root:netdata /usr/libexec/netdata/plugins.d/slabinfo.plugin
+ chmod 0750 /usr/libexec/netdata/plugins.d/slabinfo.plugin
+ if ! setcap "cap_dac_read_search=eip" /usr/libexec/netdata/plugins.d/slabinfo.plugin; then
+ chmod -f 4750 /usr/libexec/netdata/plugins.d/slabinfo.plugin
+ fi
+ ;;
+esac
+
+exit 0
diff --git a/packaging/cmake/pkg-files/deb/plugin-slabinfo/preinst b/packaging/cmake/pkg-files/deb/plugin-slabinfo/preinst
new file mode 100755
index 000000000..57615ec06
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-slabinfo/preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/plugin-systemd-journal/postinst b/packaging/cmake/pkg-files/deb/plugin-systemd-journal/postinst
new file mode 100755
index 000000000..9a2e94fc9
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-systemd-journal/postinst
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ chown root:netdata /usr/libexec/netdata/plugins.d/systemd-journal.plugin
+ chmod 0750 /usr/libexec/netdata/plugins.d/systemd-journal.plugin
+ if ! setcap "cap_dac_read_search=eip" /usr/libexec/netdata/plugins.d/systemd-journal.plugin; then
+ chmod -f 4750 /usr/libexec/netdata/plugins.d/systemd-journal.plugin
+ fi
+ ;;
+esac
+
+exit 0
diff --git a/packaging/cmake/pkg-files/deb/plugin-systemd-journal/preinst b/packaging/cmake/pkg-files/deb/plugin-systemd-journal/preinst
new file mode 100755
index 000000000..57615ec06
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-systemd-journal/preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/plugin-xenstat/postinst b/packaging/cmake/pkg-files/deb/plugin-xenstat/postinst
new file mode 100755
index 000000000..c7bb35df0
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-xenstat/postinst
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ chown root:netdata /usr/libexec/netdata/plugins.d/xenstat.plugin
+ chmod -f 4750 /usr/libexec/netdata/plugins.d/xenstat.plugin
+ ;;
+esac
+
+exit 0
diff --git a/packaging/cmake/pkg-files/deb/plugin-xenstat/preinst b/packaging/cmake/pkg-files/deb/plugin-xenstat/preinst
new file mode 100755
index 000000000..57615ec06
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/plugin-xenstat/preinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ install)
+ if ! getent group netdata > /dev/null; then
+ addgroup --quiet --system netdata
+ fi
+ ;;
+esac