From 3312c431f5db334ce8ad28ddc8c96063430c0a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Wed, 18 Jun 2008 12:41:41 +0000 Subject: [PATCH] - update init script (Resolves: #451838) --- dovecot.init | 37 ++++++++++++++++++++++++++----------- dovecot.spec | 5 ++++- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/dovecot.init b/dovecot.init index 0c26bee..b9d83af 100755 --- a/dovecot.init +++ b/dovecot.init @@ -8,6 +8,7 @@ # description: Dovecot Imap Server # processname: dovecot # config: /etc/dovecot.conf +# pidfile: /var/run/dovecot/master.pid ### BEGIN INIT INFO # Provides: dovecot @@ -28,23 +29,34 @@ RETVAL=0 prog="Dovecot Imap" +exec="/usr/sbin/dovecot" +config="/etc/dovecot.conf" +pidfile="/var/run/dovecot/master.pid" +lockfile="/var/lock/subsys/dovecot" start() { - [ -x /usr/sbin/dovecot ] || exit 5 - [ -f /etc/dovecot.conf ] || exit 6 + [ -x $exec ] || exit 5 + [ -f $config ] || exit 6 echo -n $"Starting $prog: " - daemon /usr/sbin/dovecot + daemon --pidfile $pidfile $exec RETVAL=$? - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dovecot + [ $RETVAL -eq 0 ] && touch $lockfile echo } stop() { echo -n $"Stopping $prog: " - killproc /usr/sbin/dovecot + killproc -p $pidfile $exec + RETVAL=$? + [ $RETVAL -eq 0 ] && rm -f $lockfile + echo +} + +reload() { + echo -n $"Reloading $prog: " + killproc -p $pidfile $exec -HUP RETVAL=$? - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dovecot echo } @@ -58,23 +70,26 @@ case "$1" in stop) stop ;; - reload|restart) + reload) + reload + ;; + force-reload|restart) stop start RETVAL=$? ;; - condrestart) - if [ -f /var/lock/subsys/dovecot ]; then + condrestart|try-restart) + if [ -f $lockfile ]; then stop start fi ;; status) - status /usr/sbin/dovecot + status -p $pidfile $exec RETVAL=$? ;; *) - echo $"Usage: $0 {condrestart|start|stop|restart|reload|status}" + echo $"Usage: $0 {condrestart|try-restart|start|stop|restart|reload|force-reload|status}" exit 2 esac diff --git a/dovecot.spec b/dovecot.spec index 1200d30..bff21a2 100644 --- a/dovecot.spec +++ b/dovecot.spec @@ -2,7 +2,7 @@ Summary: Dovecot Secure imap server Name: dovecot Epoch: 1 Version: 1.0.14 -Release: 3%{?dist} +Release: 4%{?dist} License: MIT and LGPLv2 and BSD with advertising Group: System Environment/Daemons @@ -388,6 +388,9 @@ fi %changelog +* Wed Jun 18 2008 Dan Horak - 1:1.0.14-4 +- update init script (Resolves: #451838) + * Fri Jun 6 2008 Dan Horak - 1:1.0.14-3 - build devel subpackage (Resolves: #306881)