summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2016-04-13 22:26:25 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2016-04-13 22:26:25 +0000
commitd4134dfdc9d538ffc075d3343eaed0b40a8a0b98 (patch)
tree55496276442c87bfc2997f50dc7c82227875c7f3
parentAdd service, dirs and lintian overrides files (diff)
downloadnetdata-d4134dfdc9d538ffc075d3343eaed0b40a8a0b98.tar.xz
netdata-d4134dfdc9d538ffc075d3343eaed0b40a8a0b98.zip
Add postrm and TODO, update service
-rw-r--r--debian/TODO.Debian4
-rw-r--r--debian/netdata.postrm36
-rw-r--r--debian/netdata.service1
3 files changed, 40 insertions, 1 deletions
diff --git a/debian/TODO.Debian b/debian/TODO.Debian
new file mode 100644
index 000000000..d2bc95ecf
--- /dev/null
+++ b/debian/TODO.Debian
@@ -0,0 +1,4 @@
+* De-vendorize JS libraries
+* Restrict security permissions in netdata.service
+* Do cleanup when apt-get purge is run
+ * delete user, /var/cache/netdata, /var/log/netdata
diff --git a/debian/netdata.postrm b/debian/netdata.postrm
new file mode 100644
index 000000000..c6ddc7e16
--- /dev/null
+++ b/debian/netdata.postrm
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ remove)
+ ;;
+
+ purge)
+ for dir_name in /var/cache/netdata /var/lib/netdata /var/lib/netdata/www; do
+ if dpkg-statoverride --list | grep -qw "$dir_name"; then
+ dpkg-statoverride --remove "$dir_name"
+ fi
+ done
+
+ if getent passwd netdata >/dev/null; then
+ if [ -x /usr/sbin/deluser ]; then
+ deluser --quiet --system netdata || echo "Unable to remove netdata user"
+ fi
+ fi
+
+ if getent group netdata >/dev/null; then
+ if [ -x /usr/sbin/delgroup ]; then
+ delgroup --quiet --system netdata || echo "Unable to remove netdata group"
+ fi
+ fi
+
+ ;;
+
+ *)
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/netdata.service b/debian/netdata.service
index de65617dc..59ca57546 100644
--- a/debian/netdata.service
+++ b/debian/netdata.service
@@ -18,7 +18,6 @@ ExecStart=/usr/sbin/netdata
ExecReload=/usr/sbin/netdata reload
#ExecStop=/bin/kill -SIGTERM $MAINPID
ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry=TERM/5/KILL/5 --pidfile /run/netdata.pid
-#ExecStop=/bin/kill -SIGTERM $MAINPID
TimeoutStopSec=30
KillMode=mixed