Package: nginx
Version: 1.2.0-1
Severity: serious
Tags: patch

The nginx-light, nginx-full and nginx-naxsi packages delete the
/etc/nginx and /var/log directory when they are purged, but the
configuration files are owned by nginx-common. This can give all sort
of problems, for example if you do "apt-get install nginx-light", then
"apt-get install nginx-full" and "dpkg --purge nginx-light" you end up
with a sytem that doesn't have an /etc/nginx or /var/log/nginx.

Attached patch moves the purging to the nginx-common package where it
belongs.

-- System Information:
Debian Release: wheezy/sid
  APT prefers precise-updates
  APT policy: (500, 'precise-updates'), (500, 'precise-security'), (500, 
'precise'), (100, 'precise-backports')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-25-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff --git a/debian/nginx-common.postrm b/debian/nginx-common.postrm
index 5992af9..14abd21 100644
--- a/debian/nginx-common.postrm
+++ b/debian/nginx-common.postrm
@@ -14,7 +14,11 @@ case "$1" in
     fi
     ;;
 
-  purge|remove|failed-upgrade|abort-install|abort-upgrade|disappear)
+  purge)
+    rm -rf /var/lib/nginx /var/log/nginx /etc/nginx
+    ;;
+
+  remove|failed-upgrade|abort-install|abort-upgrade|disappear)
     ;;
 
   *)
diff --git a/debian/nginx-full.postrm b/debian/nginx-full.postrm
deleted file mode 100644
index ce81bd5..0000000
--- a/debian/nginx-full.postrm
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-set -e
-
-case "$1" in
-  purge)
-    rm -rf /var/lib/nginx /var/log/nginx /etc/nginx
-    ;;
-
-  remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
-    ;;
-
-  *)
-    echo "postrm called with unknown argument \`$1'" >&2
-    exit 1
-esac
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/nginx-light.postrm b/debian/nginx-light.postrm
deleted file mode 100644
index ce81bd5..0000000
--- a/debian/nginx-light.postrm
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-set -e
-
-case "$1" in
-  purge)
-    rm -rf /var/lib/nginx /var/log/nginx /etc/nginx
-    ;;
-
-  remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
-    ;;
-
-  *)
-    echo "postrm called with unknown argument \`$1'" >&2
-    exit 1
-esac
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/nginx-naxsi.postrm b/debian/nginx-naxsi.postrm
deleted file mode 100644
index ce81bd5..0000000
--- a/debian/nginx-naxsi.postrm
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-set -e
-
-case "$1" in
-  purge)
-    rm -rf /var/lib/nginx /var/log/nginx /etc/nginx
-    ;;
-
-  remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
-    ;;
-
-  *)
-    echo "postrm called with unknown argument \`$1'" >&2
-    exit 1
-esac
-
-#DEBHELPER#
-
-exit 0

Reply via email to