Added more runtime dir
authorJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Tue, 18 Dec 2012 16:32:47 +0000 (16:32 +0000)
committerJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Tue, 18 Dec 2012 16:32:47 +0000 (16:32 +0000)
debian/dirs [new file with mode: 0644]
debian/postinst
debian/postrm

diff --git a/debian/dirs b/debian/dirs
new file mode 100644 (file)
index 0000000..897d6f6
--- /dev/null
@@ -0,0 +1,14 @@
+/var/lib/ais
+/var/lib/ais/db
+/var/lib/ais/db/bydate
+/var/lib/ais/db/last
+/var/lib/ais/stats
+/var/lib/ais/nmea
+/var/lib/ais/areas
+/var/lib/ais/cron
+/var/lib/ais/cron/fleets
+/var/lib/ais/jobs
+/etc/ais
+/var/log/ais
+/var/run/ais
+
index 325a8087ffd2ab4b2ee4efa2c26cd9c5cb7cc602..5aff086b80f08fc7c4db57cf4d611649e1ed2b7d 100644 (file)
@@ -24,9 +24,25 @@ case "$1" in
         addgroup --system ais
         adduser --system --home /var/lib/ais --disabled-password --ingroup ais ais
 
-        if ! dpkg-statoverride --list /var/lib/ais >/dev/null 2>&1; then
-            dpkg-statoverride --update --add ais ais 2775 /var/lib/ais
-        fi
+               for f in \
+                       /var/lib/ais \
+                       /var/lib/ais/db \
+                       /var/lib/ais/db/bydate \
+                       /var/lib/ais/db/last \
+                       /var/lib/ais/stats \
+                       /var/lib/ais/nmea \
+                       /var/lib/ais/areas \
+                       /var/lib/ais/cron \
+                       /var/lib/ais/cron/fleets \
+                       /var/lib/ais/jobs \
+                       /etc/ais \
+                       /var/log/ais \
+                       /var/run/ais
+               do
+                       if ! dpkg-statoverride --list $f >/dev/null 2>&1; then
+               dpkg-statoverride --update --add ais ais 2775 $f
+               fi
+               done
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)
index 3d08221403054156635d90f6cb224bc1ec5b3bb6..5ef2611bac4ddcea36295982971195cb3c103b3f 100644 (file)
@@ -21,9 +21,25 @@ set -e
 
 case "$1" in
        purge)
-               if dpkg-statoverride --list /var/lib/ais >/dev/null 2>&1; then
-            dpkg-statoverride --remove /var/lib/ais
-        fi
+               for f in \
+                       /var/lib/ais \
+                       /var/lib/ais/db \
+                       /var/lib/ais/db/bydate \
+                       /var/lib/ais/db/last \
+                       /var/lib/ais/stats \
+                       /var/lib/ais/nmea \
+                       /var/lib/ais/areas \
+                       /var/lib/ais/cron \
+                       /var/lib/ais/cron/fleets \
+                       /var/lib/ais/jobs \
+                       /etc/ais \
+                       /var/log/ais \
+                       /var/run/ais
+               do
+                       if dpkg-statoverride --list $f >/dev/null 2>&1; then
+                   dpkg-statoverride --remove $f
+               fi
+               done
        ;;
        remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
        ;;