summaryrefslogtreecommitdiffstats
path: root/packaging/cmake/pkg-files/deb/plugin-systemd-journal
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/cmake/pkg-files/deb/plugin-systemd-journal')
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-systemd-journal/postinst15
-rwxr-xr-xpackaging/cmake/pkg-files/deb/plugin-systemd-journal/preinst11
2 files changed, 26 insertions, 0 deletions
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