#!/bin/sh /usr/share/dpatch/dpatch-run

@DPATCH@
diff -urNad libkolab-perl-5.8.7-20070420~/Kolab/Kolab.pm.in libkolab-perl-5.8.7-20070420/Kolab/Kolab.pm.in
--- libkolab-perl-5.8.7-20070420~/Kolab/Kolab.pm.in	2007-07-27 19:17:42.000000000 +0200
+++ libkolab-perl-5.8.7-20070420/Kolab/Kolab.pm.in	2007-07-27 19:17:44.000000000 +0200
@@ -399,50 +399,28 @@
 {
     if ($haschanged{'slapd'}) {
         &log('K', 'Restarting OpenLDAP...');
-        system("@KOLABRC@ rc openldap restart &");
+        system("invoke-rc.d slapd restart &");
     }
 
     if ($haschanged{'saslauthd'}) {
         &log('K', 'Restarting SASLAuthd...');
-        system("@KOLABRC@ rc sasl stop; sleep 1; @sbindir@/saslauthd -a ldap -n 5");
+        system("invoke-rc.d saslauthd restart");
     }
 
     if ($haschanged{'apache'}) {
         &log('K', 'Reloading Apache...');
-        system("@sbindir@/apachectl graceful");
+        system("invoke-rc.d apache2 graceful");
     }
 
     if ($haschanged{'postfix'}) {
         &log('K', 'Reloading Postfix...');
-        system("@sbindir@/postfix reload");
+        system("invoke-rc.d postfix reload");
     }
 
     if ($haschanged{'imapd'}) {
         &log('K', 'Restarting imapd...');
 	# Would it be enough with a reload here? /steffen
-        system("@KOLABRC@ rc imapd restart");
-    }
-
-    if ($haschanged{'amavisd'}) {
-        &log('K', 'Restarting amavisd...');
-        system("@KOLABRC@ rc amavisd restart");
-    }
-
-    if ($haschanged{'clamav'}) {
-        &log('K', 'Restarting clamav...');
-        system("@KOLABRC@ rc clamav restart");
-    }
-
-    if ($config{'proftpd-ftp'} =~ /true/i) {
-        Kolab::log('K', 'Starting ProFTPd if not running');
-        system("@KOLABRC@ rc proftpd start");
-        if ($haschanged{'proftpd'}) {
-            &log('K', 'Reloading ProFTPd...');
-            kill('SIGHUP', `cat @ftpserver_pidfile@`);
-        }
-    } else {
-        &log('K', 'Stopping ProFTPd, if running...');
-        system("@KOLABRC@ rc proftpd stop");
+        system("invoke-rc.d kolab-cyrus restart");
     }
 
     %Kolab::Conf::haschanged = ();
