diff options
author | Federico Ceratto <federico.ceratto@gmail.com> | 2016-04-13 22:26:25 +0000 |
---|---|---|
committer | Federico Ceratto <federico.ceratto@gmail.com> | 2016-04-13 22:26:25 +0000 |
commit | d4134dfdc9d538ffc075d3343eaed0b40a8a0b98 (patch) | |
tree | 55496276442c87bfc2997f50dc7c82227875c7f3 | |
parent | Add service, dirs and lintian overrides files (diff) | |
download | netdata-d4134dfdc9d538ffc075d3343eaed0b40a8a0b98.tar.xz netdata-d4134dfdc9d538ffc075d3343eaed0b40a8a0b98.zip |
Add postrm and TODO, update service
-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 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 |