X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=courier-imap.init;h=bd811796694daca0eddd76f51d93508fb220e208;hb=e33939aabfb38d241e3786ba9a280b2b3f0b3553;hp=b5dc3801602b4697e24ecb603dd8f102e372f072;hpb=e93af56dabb62ea8af1c24c6724566cee80b1e32;p=packages%2Fcourier-imap.git diff --git a/courier-imap.init b/courier-imap.init index b5dc380..bd81179 100644 --- a/courier-imap.init +++ b/courier-imap.init @@ -10,62 +10,112 @@ # Get network config . /etc/sysconfig/network +ADDRESS=0.0.0.0 +MAXPERIP=4 +MAXDAEMONS=40 +MAILDIR="Maildir" +TCPDOPTS= +IMAPDSSLSTART="no" + # Get service config [ -f /etc/sysconfig/courier-imap ] && . /etc/sysconfig/courier-imap # Check that networking is up. -if [ "${NETWORKING}" = "no" ]; then - nls "WARNING: Networking is down. IMAP service can't be runed." - exit 1 +if is_yes "${NETWORKING}"; then + if [ ! -f /var/lock/subsys/network ]; then + msg_network_down "Courier IMAP" + exit 1 + fi +else + exit 0 fi - +RETVAL=0 # See how we were called. case "$1" in start) # Check if the service is already running? if [ ! -f /var/lock/subsys/courier-imap ]; then - show Starting IMAP Daemon + # start authdaemon, if not running.. + if [ ! -f /var/lock/subsys/authdaemon -a \ + -x /etc/rc.d/init.d/authdaemon ]; then + /etc/rc.d/init.d/authdaemon start + RETVAL=$? + if [ $RETVAL -ne 0 ]; then + msg_starting "Courier IMAP" + fail + exit 1 + fi + fi + msg_starting "Courier IMAP" busy - - LIBAUTHMODULES="" - for f in `echo $AUTHMODULES`; do - LIBAUTHMODULES="$LIBAUTHMODULES /usr/lib/courier-imap/$f" - done - - /usr/lib/courier-imap/couriertcpd -address=$ADDRESS \ - -maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP \ - -pid=/var/run/imapd.pid -stderrlogger=/usr/lib/courier-imap/logger \ - -forcebind -nodnslookup -noidentlookup $PORT \ - /usr/bin/imaplogin $LIBAUTHMODULES /usr/bin/imapd $MAILDIR & - - if ps ax | grep -v grep | grep -q couriertcpd; then - deltext;ok + ulimit -d $IMAP_ULIMITD + /usr/bin/env - /bin/sh -c " . /etc/sysconfig/courier-imap ; \ + `sed -n '/^#/d;/=/p'