#!/bin/bash # # imapproxy: Starts the University of Pittsburgh IMAP Proxy # # chkconfig: - 75 25 # description: imapproxy was written to compensate for webmail clients that \ # are unable to maintain persistent connections to an IMAP \ # server. Most webmail clients need to log in to an IMAP server \ # for nearly every single transaction. This behaviour can cause \ # tragic performance problems on the IMAP server. imapproxy \ # tries to deal with this problem by leaving server connections \ # open for a short time after a webmail client logs out. When \ # the webmail client connects again, imapproxy will determine if \ # there's a cached connection available and reuse it if possible. # processname: in.imapproxyd # config: /etc/imapproxy.conf # Source function library. . /etc/init.d/functions . /etc/sysconfig/network exec="/usr/sbin/in.imapproxyd" prog="imapproxy" # Check that networking is configured. [ ${NETWORKING} = "no" ] && exit 0 RETVAL=0 lockfile=/var/lock/subsys/$prog start() { [ -x $exec ] || exit 5 echo -n $"Starting up-imapproxy daemon: " daemon $exec RETVAL=$? echo [ $RETVAL -eq 0 ] && touch $lockfile return $RETVAL } stop() { echo -n $"Shutting down up-imapproxy daemon: " killproc /usr/sbin/in.imapproxyd RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f $lockfile return $RETVAL } restart() { stop start } reload() { restart } force_reload() { restart } fd_status() { status $prog } fd_status_q() { fd_status >/dev/null 2>&1 } # See how we were called. case "$1" in start) fd_status_q && exit 0 $1 ;; stop) fd_status_q || exit 0 $1 ;; status) fd_status ;; restart) $1 ;; reload) fd_status_q || exit 7 $1 ;; force-reload) force_reload ;; condrestart|try-restart) fd_status_q || exit 0 restart ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" exit 2 esac exit $?