Paul J Stevens wrote:
> Aaron Stone wrote:
>   
>> On Wed, 2007-03-14 at 19:02 +1100, Jake Anderson wrote:
>>
>>     
>>> I've had problems with it not creating the PID directory if it didn't
>>> already exist in ubuntu.
>>>       
>> DBMail won't create the pid directory if it doesn't exist.
>>     
>
> No, but the debian packages should, and do. I just re-verified this on
> my pristine sid xen machine.
>
> What packages were you using on ubuntu?
>   
>   
2.2.2-1

i got them from the source listed on the dbmail website. I had to change
a dep or 2 in the control file to work on 6.06 (libc i think) and a
gmime dep for libsieve in 6.10 but that was about all.

this is the init.d script i just pulled out of the package
(you can see them at ubuntu.vapourforge.com if your keen)
I'm waiting for 2.2.4 to be well received before i update.

#!/bin/sh
#
# dbmail init script for debian
#
# written by Paul J Stevens, 2004-2006
#
#
### BEGIN INIT INFO
# Provides:          dbmail
# Required-Start:    $local_fs $remote_fs $syslog $network
# Required-Stop:     $local_fs $remote_fs $syslog $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start dbmail services
# Description:       Run network services provided by dbmail such as
#                    imap-server, pop3-server, lmtp-server, timsieve-server
### END INIT INFO


PATH=/sbin:/bin:/usr/sbin:/usr/bin

IMAPD=/usr/sbin/dbmail-imapd
POP3D=/usr/sbin/dbmail-pop3d
LMTPD=/usr/sbin/dbmail-lmtpd
SIEVE=/usr/sbin/dbmail-timsieved

IMAPD_NAME=dbmail-imapd
POP3D_NAME=dbmail-pop3d
LMTPD_NAME=dbmail-lmtpd
SIEVE_NAME=dbmail-timsieved

NAME="dbmail"

PID_DIR="/var/run/$NAME/"

DESC="dbmail servers"

test -x $IMAPD || exit 0
test -x $POP3D || exit 0
test -x $LMTPD || exit 0

set -e

. /lib/lsb/init-functions

[ -e /etc/default/dbmail ] && . /etc/default/dbmail

service_start() {
    eval '_daemon=$'$1
    eval '_name=$'$1'_NAME'
    [ -e $_daemon ] || return 0
   
    log_progress_msg "$_name"
    start-stop-daemon --start --exec $_daemon
   
    r=$?
    if [ $r -gt 0 ]; then
        log_failure_msg "failed"
        return $r
    fi
   
    return 0
   
}


service_stop() {
    eval '_daemon=$'$1
    eval '_name=$'$1'_NAME'
   
    log_progress_msg "$_name"
    start-stop-daemon --stop --retry 10 \
        --pidfile ${PID_DIR}/${_name}.pid >/dev/null 2>&1 || true

    pids=`pidof ${_name}`
    if [ -n  "$pids" ]; then
    echo "=[$pids]="
        log_failure_msg "failed"
        return 1
    fi
   
    return 0
   
}
   
service_reload() {
    eval '_daemon=$'$1
    eval '_name=$'$1'_NAME'
   
    log_progress_msg "$_name"
    start-stop-daemon --stop --signal HUP --quiet --pidfile
${PID_DIR}/${_name}.pid
   
    r=$?
    if [ $r -gt 0 ]; then
        log_failure_msg "failed"
        return $r
    fi
   
    return 0
   
}

case "$1" in
  start)
    log_daemon_msg "Starting $DESC"
    r=0
    if [ "$START_IMAPD" ]; then service_start "IMAPD" || r=1; fi
    if [ "$START_POP3D" ]; then service_start "POP3D" || r=1; fi
    if [ "$START_LMTPD" ]; then service_start "LMTPD" || r=1; fi
    if [ "$START_SIEVE" ]; then service_start "SIEVE" || r=1; fi
     log_end_msg $r
    ;;
   
  stop)
    log_daemon_msg "Stopping $DESC"
    r=0
    if [ "$START_IMAPD" ]; then service_stop "IMAPD" || r=1; fi
    if [ "$START_POP3D" ]; then service_stop "POP3D" || r=1; fi
    if [ "$START_LMTPD" ]; then service_stop "LMTPD" || r=1; fi
    if [ "$START_SIEVE" ]; then service_stop "SIEVE" || r=1; fi
    log_end_msg $r
    ;;
   
  reload)
      log_daemon_msg "Reloading $DESC"
    r=0
    if [ "$START_IMAPD" ]; then service_reload "IMAPD" || r=1; fi
    if [ "$START_POP3D" ]; then service_reload "POP3D" || r=1; fi
    if [ "$START_LMTPD" ]; then service_reload "LMTPD" || r=1; fi
    if [ "$START_SIEVE" ]; then service_reload "SIEVE" || r=1; fi
    log_end_msg $r
    ;;
   
  restart|force-reload)
    $0 stop
    $0 start
    ;;
  *)
    N="$NAME"
    echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
    exit 1
    ;;
esac

exit 0


_______________________________________________
DBmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail

Reply via email to