diff options
-rw-r--r-- | debian/TODO.Debian | 4 | ||||
-rw-r--r-- | debian/netdata.postrm | 36 | ||||
-rw-r--r-- | debian/netdata.service | 1 |
3 files changed, 40 insertions, 1 deletions
diff --git a/debian/TODO.Debian b/debian/TODO.Debian new file mode 100644 index 00000000..d2bc95ec --- /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 00000000..c6ddc7e1 --- /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 de65617d..59ca5754 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 |