summaryrefslogtreecommitdiff
path: root/extra/dovecot
diff options
context:
space:
mode:
authorNicolas Reynolds <fauno@kiwwwi.com.ar>2011-08-11 11:14:03 -0300
committerNicolas Reynolds <fauno@kiwwwi.com.ar>2011-08-11 11:14:03 -0300
commit828f6a7c0f0285abf2b1fb91895406dcb5d5b0e5 (patch)
treefb283e1b49ba0e6a1fbb3748cc6600facf62fdc4 /extra/dovecot
parent015d5bbcdc8bd4c24cd79582d13225844045d2ec (diff)
parente81c6fe4fb38144709923b2da3ab68a01712a26b (diff)
Merge branch 'master' of ssh://vparabola/home/parabola/abslibre-pre-mips64el
Conflicts: extra/flac/PKGBUILD extra/glib/PKGBUILD extra/gnome-control-center/PKGBUILD extra/qiv/PKGBUILD extra/vamp-plugin-sdk/PKGBUILD extra/vcdimager/PKGBUILD extra/xorg-server/PKGBUILD
Diffstat (limited to 'extra/dovecot')
-rw-r--r--extra/dovecot/PKGBUILD13
-rw-r--r--extra/dovecot/dovecot.install18
-rwxr-xr-xextra/dovecot/dovecot.sh89
3 files changed, 76 insertions, 44 deletions
diff --git a/extra/dovecot/PKGBUILD b/extra/dovecot/PKGBUILD
index 179624811..776e0e882 100644
--- a/extra/dovecot/PKGBUILD
+++ b/extra/dovecot/PKGBUILD
@@ -1,12 +1,12 @@
-# $Id: PKGBUILD 123590 2011-05-11 17:20:39Z andyrtr $
+# $Id: PKGBUILD 134967 2011-08-09 17:31:55Z andyrtr $
+# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Contributor: Paul Mattal <paul@mattal.com>
# Contributor: Federico Quagliata (quaqo) <quaqo@despammed.com>
# Contributor: GARETTE Emmanuel <gnunux at laposte dot net>
-# Maintainer: Andreas Radke <andyrtr@archlinux.org>
pkgname=dovecot
pkgver=2.0.13
-pkgrel=1
+pkgrel=2
pkgdesc="An IMAP and POP3 server written with security primarily in mind"
arch=('i686' 'x86_64' 'mips64el')
url="http://dovecot.org/"
@@ -26,7 +26,7 @@ backup=(etc/dovecot/dovecot.conf
install=$pkgname.install
source=(http://dovecot.org/releases/2.0/${pkgname}-${pkgver}.tar.gz dovecot.sh)
md5sums=('fd8a0702275a61332db7353dadff0f92'
- 'd020d43eab4ded6fb379dadc570a9490')
+ '587159e84e2da6f83d70b3c706ba87cc')
build() {
cd ${srcdir}/$pkgname-$pkgver
@@ -66,9 +66,4 @@ package() {
install -m 644 ${srcdir}/$pkgname-$pkgver/doc/dovecot-openssl.cnf ${pkgdir}/etc/ssl/
rm ${pkgdir}/etc/dovecot/README
-
- # install dovecot userdir - https://bugs.archlinux.org/task/20533
- install -d -m755 ${pkgdir}/var/run/dovecot/{login,empty}
- chmod 755 ${pkgdir}/var/run/dovecot
- chmod 750 ${pkgdir}/var/run/dovecot/login
}
diff --git a/extra/dovecot/dovecot.install b/extra/dovecot/dovecot.install
index 51d1509ee..ddec178a4 100644
--- a/extra/dovecot/dovecot.install
+++ b/extra/dovecot/dovecot.install
@@ -11,9 +11,9 @@ post_install() {
fi
if grep -q "^dovecot:" /etc/passwd 2> /dev/null ; then
- usermod -s /sbin/nologin -c "Dovecot user" -d /var/run/dovecot/login -u 76 -g dovecot dovecot &> /dev/null
+ usermod -s /sbin/nologin -c "Dovecot user" -d /var/empty -u 76 -g dovecot dovecot &> /dev/null
else
- useradd -s /sbin/nologin -c "Dovecot user" -d /var/run/dovecot/login -u 76 -g dovecot -m -r dovecot &> /dev/null
+ useradd -s /sbin/nologin -c "Dovecot user" -d /var/empty -u 76 -g dovecot -r dovecot &> /dev/null
fi
# dovenull
@@ -24,9 +24,9 @@ post_install() {
fi
if grep -q "^dovenull:" /etc/passwd 2> /dev/null ; then
- usermod -s /sbin/nologin -c "Dovecot user for completely untrustworthy processes" -d /var/run/dovecot/login -u 74 -g dovenull dovenull &> /dev/null
+ usermod -s /sbin/nologin -c "Dovecot user for completely untrustworthy processes" -d /var/empty -u 74 -g dovenull dovenull &> /dev/null
else
- useradd -s /sbin/nologin -c "Dovecot user for completely untrustworthy processes" -d /var/run/dovecot/login -u 74 -g dovenull -m -r dovenull &> /dev/null
+ useradd -s /sbin/nologin -c "Dovecot user for completely untrustworthy processes" -d /var/empty -u 74 -g dovenull -r dovenull &> /dev/null
fi
# harden some permissions
@@ -36,15 +36,19 @@ post_install() {
# arg 1: the new package version
# arg 2: the old package version
post_upgrade() {
- post_install $1
if [ "`vercmp $2 2.0.0`" -lt 0 ]; then
# important upgrade notice
echo "> IMPORTANT DOVECOT 2.0 UPGRADE NOTICE"
echo "> ------------------------------------"
echo "> see http://wiki2.dovecot.org/Upgrading/2.0"
echo "> make sure, you convert the dovecot.conf file"
- fi
-
+ fi
+ if [ "`vercmp $2 2.0.13-2`" -lt 0 ]; then
+ # to remove no more existant usersdirs simply remove the dovecot users and let them recreate later
+ userdel dovecot &> /dev/null
+ userdel dovenull &> /dev/null
+ fi
+ post_install $1
}
# arg 1: the old package version
diff --git a/extra/dovecot/dovecot.sh b/extra/dovecot/dovecot.sh
index b7555fe50..e8966bd55 100755
--- a/extra/dovecot/dovecot.sh
+++ b/extra/dovecot/dovecot.sh
@@ -1,36 +1,69 @@
#!/bin/bash
+daemon_name=dovecot
+
. /etc/rc.conf
. /etc/rc.d/functions
+#. /etc/conf.d/$daemon_name.conf
+
+get_pid() {
+ pidof -o %PPID $daemon_name
+}
-PID=`pidof -o %PPID /usr/sbin/dovecot`
case "$1" in
- start)
- stat_busy "Starting Dovecot"
- [ -z "$PID" ] && /usr/sbin/dovecot
- if [ $? -gt 0 ]; then
- stat_fail
- else
- add_daemon dovecot
- stat_done
- fi
- ;;
- stop)
- stat_busy "Stopping Dovecot"
- [ ! -z "$PID" ] && kill $PID &> /dev/null
- if [ $? -gt 0 ]; then
- stat_fail
- else
- rm_daemon dovecot
- stat_done
- fi
- ;;
- restart)
- $0 stop
- sleep 2
- $0 start
- ;;
- *)
- echo "usage: $0 {start|stop|restart}"
+ start)
+ stat_busy "Starting $daemon_name daemon"
+
+ PID=$(get_pid)
+ if [[ -z $PID ]]; then
+ [[ -f /var/run/$daemon_name.pid ]] &&
+ rm -f /var/run/$daemon_name.pid
+ # RUN
+ $daemon_name
+ #
+ if [[ $? -gt 0 ]]; then
+ stat_fail
+ exit 1
+ else
+ echo $(get_pid) > /var/run/$daemon_name.pid
+ add_daemon $daemon_name
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ stop)
+ stat_busy "Stopping $daemon_name daemon"
+ PID=$(get_pid)
+ # KILL
+ [[ -n $PID ]] && kill $PID &> /dev/null
+ #
+ if [[ $? -gt 0 ]]; then
+ stat_fail
+ exit 1
+ else
+ rm -f /var/run/$daemon_name.pid &> /dev/null
+ rm_daemon $daemon_name
+ stat_done
+ fi
+ ;;
+
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+
+ status)
+ stat_busy "Checking $daemon_name status";
+ ck_status $daemon_name
+ ;;
+
+ *)
+ echo "usage: $0 {start|stop|restart|status}"
esac
+
exit 0