summaryrefslogtreecommitdiffstats
path: root/packaging/cmake/pkg-files
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/cmake/pkg-files')
-rwxr-xr-xpackaging/cmake/pkg-files/deb/dashboard/postinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/dashboard/postrm17
-rwxr-xr-xpackaging/cmake/pkg-files/deb/dashboard/preinst11
-rwxr-xr-xpackaging/cmake/pkg-files/deb/netdata/postinst4
-rwxr-xr-xpackaging/cmake/pkg-files/deb/netdata/postrm8
5 files changed, 39 insertions, 12 deletions
diff --git a/packaging/cmake/pkg-files/deb/dashboard/postinst b/packaging/cmake/pkg-files/deb/dashboard/postinst
new file mode 100755
index 000000000..320a649d9
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/dashboard/postinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ 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
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/dashboard/postrm b/packaging/cmake/pkg-files/deb/dashboard/postrm
new file mode 100755
index 000000000..85438ad12
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/dashboard/postrm
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ remove) ;;
+
+ purge)
+ 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
+ ;;
+esac
diff --git a/packaging/cmake/pkg-files/deb/dashboard/preinst b/packaging/cmake/pkg-files/deb/dashboard/preinst
new file mode 100755
index 000000000..57615ec06
--- /dev/null
+++ b/packaging/cmake/pkg-files/deb/dashboard/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/netdata/postinst b/packaging/cmake/pkg-files/deb/netdata/postinst
index 97593c23b..7d2f0690a 100755
--- a/packaging/cmake/pkg-files/deb/netdata/postinst
+++ b/packaging/cmake/pkg-files/deb/netdata/postinst
@@ -20,10 +20,6 @@ case "$1" in
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
diff --git a/packaging/cmake/pkg-files/deb/netdata/postrm b/packaging/cmake/pkg-files/deb/netdata/postrm
index 7a636863b..daf28b74d 100755
--- a/packaging/cmake/pkg-files/deb/netdata/postrm
+++ b/packaging/cmake/pkg-files/deb/netdata/postrm
@@ -10,14 +10,6 @@ case "$1" in
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