- ispravke razlicitih Lintian gresaka, kao logike (registriranje
authorDinko Korunic <kreator@carnet.hr>
Sat, 2 Apr 2011 14:12:19 +0000 (16:12 +0200)
committerDinko Korunic <kreator@carnet.hr>
Sat, 2 Apr 2011 14:12:19 +0000 (16:12 +0200)
  amavisd-cn init skripte mjesto amavis skripte i vracanje nakon
  deinstalacije paketa)

debian/changelog
debian/conffiles
debian/control
debian/init
debian/postinst
debian/postrm
debian/rules
src/functions.sh [changed mode: 0755->0644]
src/postfix.sh [changed mode: 0755->0644]
src/sendmail.sh [changed mode: 0755->0644]
src/variables.sh [changed mode: 0755->0644]

index 207d736..d16e839 100644 (file)
@@ -2,6 +2,8 @@ amavisd-cn (3:2.6.4-1) stable; urgency=low
 
   * #23256: insserv i init skripta
   * vise se ne koristi /etc/init.d/amavis, vec samo /etc/init.d/amavisd-cn
+  * ispravke razlicitih Lintian gresaka, kao logike (registriranje amavisd-cn
+    init skripte mjesto amavis skripte i vracanje nakon deinstalacije paketa)
 
  -- Dinko Korunic <kreator@carnet.hr>  Sat, 02 Apr 2011 12:28:15 +0200
 
@@ -189,7 +191,7 @@ amavisd-cn (2:20030616p10-1) testing; urgency=low
   * chown datoteka u slucaju upgradea sa woodyja.
   * Dodavanje grupe amavis ako je potrebno.
 
- -- Zeljko Boros <zelja@ravnica.ptfos.hr>
+ -- Zeljko Boros <zelja@ravnica.ptfos.hr>  Wed, 24 Mar 2004 10:26:51 +0100
 
 amavisd-cn (20030616p7-3) testing; urgency=low
 
index e69de29..d8ebbc6 100644 (file)
@@ -0,0 +1 @@
+/etc/init.d/amavisd-cn
index a843ebe..1d65bad 100644 (file)
@@ -8,7 +8,7 @@ Standards-Version: 3.9.1
 Package: amavisd-cn
 Architecture: all
 Provides: amavisd-new-cn
-Depends: amavisd-new (>= 1:2.6.4-3), postfix, clamav-cn (>= 3:0.94-5), spamassassin-cn (>= 2:3.2.5-6), debianutils, carnet-tools-cn (>= 2.8.1), procps, arj | unarj, rar | unrar | unrar-free, zoo, nomarch, cpio, lzop, cabextract, zip, unzip, bzip2
+Depends: amavisd-new (>= 1:2.6.4-3), postfix, clamav-cn (>= 3:0.94-5), spamassassin-cn (>= 2:3.2.5-6), debianutils (>= 3.4), carnet-tools-cn (>= 2.8.1), procps, arj | unarj, rar | unrar | unrar-free, zoo, nomarch, cpio, lzop, cabextract, zip, unzip, bzip2
 Pre-Depends: amavisd-new (>= 1:2.6.4-3)
 Recommends: postfix-cn
 Conflicts: libsavi-perl (<< 0.15), bunch-perl-modules-cn
index b689825..3f1b26a 100755 (executable)
@@ -131,11 +131,23 @@ case "$arg" in
   istart)
        start clamd
        start amavis
-       /etc/init.d/$mta start
+    if [ -x "/etc/init.d/$mta" ]; then
+            if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+                    invoke-rc.d $mta start
+            else
+                    /etc/init.d/$mta start
+            fi
+    fi
        ;;
 
   istop)
-       /etc/init.d/$mta stop
+    if [ -x "/etc/init.d/$mta" ]; then
+            if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+                    invoke-rc.d $mta stop
+            else
+                    /etc/init.d/$mta stop
+            fi
+    fi
        stop amavis
        stop clamd
        ;;
index ee3f156..56a0755 100755 (executable)
@@ -110,26 +110,60 @@ fi
 
 # kill naughty pyzor descendants -- XXX needed for 2.4 or not?
 if dpkg --compare-versions "$2" lt 2:20030616p10-7 && \
-    pgrep -u amavis -f '/usr/bin/pyzor check' > /dev/null; then
-  /etc/init.d/amavisd-cn stop
+  pgrep -u amavis -f '/usr/bin/pyzor check' > /dev/null; then
+  if [ -x "/etc/init.d/amavisd-cn" ]; then
+    if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+      invoke-rc.d amavisd-cn stop
+    else
+      /etc/init.d/amavisd-cn stop
+    fi
+  fi
   pkill -9 -u amavis -f '/usr/bin/pyzor check' > /dev/null || true
-  /etc/init.d/amavisd-cn start
+  if [ -x "/etc/init.d/amavisd-cn" ]; then
+    if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+      invoke-rc.d amavisd-cn start
+    else
+      /etc/init.d/amavisd-cn start
+    fi
+  fi
   restart_daemon=
   restart_mta=
 fi
 
+# register for automatic start
+update-rc.d -f amavis remove >/dev/null || true
+update-rc.d amavisd-cn defaults 19 21 >/dev/null
+
 # START AMAVISD
 # about a half of amavisd-cn script is here
 if [ "$restart_daemon" -a -x /etc/init.d/amavis.amavisd-new ]; then
-  /etc/init.d/amavis.amavisd-new restart
+  if [ -x "/etc/init.d/amavis.amavisd-new" ]; then
+    if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+      invoke-rc.d amavis.amavisd-new restart
+    else
+      /etc/init.d/amavis.amavisd-new restart
+    fi
+  fi
 fi
 # always check that the daemons are running
 if ! wait_for_fds amavis; then
-  /etc/init.d/amavis.amavisd-new start
+  if [ -x "/etc/init.d/amavis.amavisd-new" ]; then
+    if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+      invoke-rc.d amavis.amavisd-new start
+    else
+      /etc/init.d/amavis.amavisd-new start
+    fi
+  fi
   wait_for_fds amavis
 fi
 if [ "$restart_mta" ]; then
-  /etc/init.d/$mta restart
+  if [ -x "/etc/init.d/$mta" ]; then
+    if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+      invoke-rc.d $mta restart
+    else
+      /etc/init.d/$mta restart
+    fi
+  fi
 fi
 
 # this needs to be updated when $CRONTAB file changes
index e099a6a..593ba8a 100755 (executable)
@@ -6,6 +6,7 @@ if [ "$1" = remove ]; then
   rm -f /etc/init.d/amavis
   dpkg-divert --quiet --package amavisd-cn --remove --rename \
     --divert /etc/init.d/amavis.amavisd-new /etc/init.d/amavis || true
+  update-rc.d amavis defaults 19 21 >/dev/null || true
 fi
 
 if [ "$1" = purge ]; then
@@ -13,4 +14,5 @@ if [ "$1" = purge ]; then
   # /var/run/amavis now deleted in /etc/init.d/amavisd
   # keeping virusmails until --purge is used
   rm -fr /var/lib/amavis/amavis*
+  update-rc.d amavisd-cn remove >/dev/null || true
 fi
index 93ad00b..1f1ea6c 100755 (executable)
@@ -72,14 +72,13 @@ binary-arch: build install
 #      dh_installman
 #      dh_link
 #      dh_strip
-#      dh_compress
+       dh_compress
        dh_fixperms
 #      dh_perl
 #      dh_python
 #      dh_makeshlibs
        dh_installdeb
 #      dh_shlibdeps
-       sed -i '/init\.d/d' debian/amavisd-cn/DEBIAN/conffiles
        dh_gencontrol
        dh_md5sums
        dh_builddeb
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)