diff options
author | James Mills <1290234+prologic@users.noreply.github.com> | 2020-01-24 12:39:36 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-24 12:39:36 +1000 |
commit | 25f93c8354fd3d8288a9ce4bb860aaf9ddad24e1 (patch) | |
tree | 92ee3708c7b975382b087342d5c3e1edbd77b8f7 | |
parent | c53e772b97509ea3bfa96331588915b39290c7d2 (diff) |
Don't remove groups/users in Debian postrm (#7817)
-rw-r--r-- | contrib/debian/netdata.postrm | 75 |
1 files changed, 29 insertions, 46 deletions
diff --git a/contrib/debian/netdata.postrm b/contrib/debian/netdata.postrm index de93dad1ae..d16fb9d799 100644 --- a/contrib/debian/netdata.postrm +++ b/contrib/debian/netdata.postrm @@ -1,60 +1,43 @@ -#! /bin/sh +#!/bin/sh set -e dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/.well-known /usr/share/netdata/www/.well-known 1.18.1~ netdata -- "$@" + /var/lib/netdata/www/.well-known /usr/share/netdata/www/.well-known 1.18.1~ netdata -- "$@" dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/css /usr/share/netdata/www/css 1.18.1~ netdata -- "$@" + /var/lib/netdata/www/css /usr/share/netdata/www/css 1.18.1~ netdata -- "$@" dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/fonts /usr/share/netdata/www/fonts 1.18.1~ netdata -- "$@" + /var/lib/netdata/www/fonts /usr/share/netdata/www/fonts 1.18.1~ netdata -- "$@" dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/images /usr/share/netdata/www/images 1.18.1~ netdata -- "$@" + /var/lib/netdata/www/images /usr/share/netdata/www/images 1.18.1~ netdata -- "$@" dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/lib /usr/share/netdata/www/lib 1.18.1~ netdata -- "$@" + /var/lib/netdata/www/lib /usr/share/netdata/www/lib 1.18.1~ netdata -- "$@" dpkg-maintscript-helper dir_to_symlink \ - /var/lib/netdata/www/static /usr/share/netdata/www/static 1.18.1~ netdata -- "$@" + /var/lib/netdata/www/static /usr/share/netdata/www/static 1.18.1~ netdata -- "$@" case "$1" in - remove) - ;; - - purge) - if dpkg-statoverride --list | grep -qw /var/cache/netdata; then - 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 /var/lib/netdata/registry; then - dpkg-statoverride --remove /var/lib/netdata/registry - fi - - if dpkg-statoverride --list | grep -qw /var/lib/netdata; then - dpkg-statoverride --remove /var/lib/netdata - fi - - 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 + remove) ;; -#DEBHELPER# + purge) + if dpkg-statoverride --list | grep -qw /var/cache/netdata; then + dpkg-statoverride --remove /var/cache/netdata + fi -exit 0 + 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 /var/lib/netdata/registry; then + dpkg-statoverride --remove /var/lib/netdata/registry + fi + + if dpkg-statoverride --list | grep -qw /var/lib/netdata; then + dpkg-statoverride --remove /var/lib/netdata + fi + ;; + *) ;; + +esac + +exit 0 |