- update init script (Resolves: #451838)

This commit is contained in:
Dan Horák 2008-06-18 12:41:41 +00:00
parent 5122e8d9b6
commit 3312c431f5
2 changed files with 30 additions and 12 deletions

View File

@ -8,6 +8,7 @@
# description: Dovecot Imap Server # description: Dovecot Imap Server
# processname: dovecot # processname: dovecot
# config: /etc/dovecot.conf # config: /etc/dovecot.conf
# pidfile: /var/run/dovecot/master.pid
### BEGIN INIT INFO ### BEGIN INIT INFO
# Provides: dovecot # Provides: dovecot
@ -28,23 +29,34 @@
RETVAL=0 RETVAL=0
prog="Dovecot Imap" prog="Dovecot Imap"
exec="/usr/sbin/dovecot"
config="/etc/dovecot.conf"
pidfile="/var/run/dovecot/master.pid"
lockfile="/var/lock/subsys/dovecot"
start() { start() {
[ -x /usr/sbin/dovecot ] || exit 5 [ -x $exec ] || exit 5
[ -f /etc/dovecot.conf ] || exit 6 [ -f $config ] || exit 6
echo -n $"Starting $prog: " echo -n $"Starting $prog: "
daemon /usr/sbin/dovecot daemon --pidfile $pidfile $exec
RETVAL=$? RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dovecot [ $RETVAL -eq 0 ] && touch $lockfile
echo echo
} }
stop() { stop() {
echo -n $"Stopping $prog: " 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=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dovecot
echo echo
} }
@ -58,23 +70,26 @@ case "$1" in
stop) stop)
stop stop
;; ;;
reload|restart) reload)
reload
;;
force-reload|restart)
stop stop
start start
RETVAL=$? RETVAL=$?
;; ;;
condrestart) condrestart|try-restart)
if [ -f /var/lock/subsys/dovecot ]; then if [ -f $lockfile ]; then
stop stop
start start
fi fi
;; ;;
status) status)
status /usr/sbin/dovecot status -p $pidfile $exec
RETVAL=$? 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 exit 2
esac esac

View File

@ -2,7 +2,7 @@ Summary: Dovecot Secure imap server
Name: dovecot Name: dovecot
Epoch: 1 Epoch: 1
Version: 1.0.14 Version: 1.0.14
Release: 3%{?dist} Release: 4%{?dist}
License: MIT and LGPLv2 and BSD with advertising License: MIT and LGPLv2 and BSD with advertising
Group: System Environment/Daemons Group: System Environment/Daemons
@ -388,6 +388,9 @@ fi
%changelog %changelog
* Wed Jun 18 2008 Dan Horak <dan[at]danny.cz> - 1:1.0.14-4
- update init script (Resolves: #451838)
* Fri Jun 6 2008 Dan Horak <dan[at]danny.cz> - 1:1.0.14-3 * Fri Jun 6 2008 Dan Horak <dan[at]danny.cz> - 1:1.0.14-3
- build devel subpackage (Resolves: #306881) - build devel subpackage (Resolves: #306881)