]>
Commit | Line | Data |
---|---|---|
e93af56d | 1 | #!/bin/sh |
2 | # IMAP Daemon | |
3 | # | |
4 | # chkconfig: 345 80 20 | |
5 | # description: IMAP Daemon | |
6 | ||
7 | # Source function library | |
8 | . /etc/rc.d/init.d/functions | |
9 | ||
10 | # Get network config | |
11 | . /etc/sysconfig/network | |
12 | ||
13 | # Get service config | |
14 | [ -f /etc/sysconfig/courier-imap ] && . /etc/sysconfig/courier-imap | |
15 | ||
16 | # Check that networking is up. | |
f26425db JR |
17 | if is_no "${NETWORKING}" ; then |
18 | msg_Network_Down IMAP | |
e93af56d | 19 | exit 1 |
20 | fi | |
21 | ||
e93af56d | 22 | # See how we were called. |
23 | case "$1" in | |
24 | start) | |
25 | # Check if the service is already running? | |
26 | if [ ! -f /var/lock/subsys/courier-imap ]; then | |
f26425db | 27 | msg_starting IMAP |
e93af56d | 28 | busy |
29 | ||
30 | LIBAUTHMODULES="" | |
31 | for f in `echo $AUTHMODULES`; do | |
4707f0bb | 32 | LIBAUTHMODULES="$LIBAUTHMODULES /usr/lib/courier-imap/authlib/$f" |
e93af56d | 33 | done |
34 | ||
35 | /usr/lib/courier-imap/couriertcpd -address=$ADDRESS \ | |
36 | -maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP \ | |
37 | -pid=/var/run/imapd.pid -stderrlogger=/usr/lib/courier-imap/logger \ | |
38 | -forcebind -nodnslookup -noidentlookup $PORT \ | |
4707f0bb | 39 | /usr/sbin/imaplogin $LIBAUTHMODULES /usr/bin/imapd $MAILDIR & |
e93af56d | 40 | |
4707f0bb | 41 | if ps -C couriertcpd >/dev/null 2>&1; then |
f26425db | 42 | touch /var/lock/subsys/courier-imap |
4707f0bb | 43 | ok |
e93af56d | 44 | else |
4707f0bb | 45 | fail |
e93af56d | 46 | fi |
47 | else | |
f26425db JR |
48 | msg_Already_Running IMAP |
49 | exit 1 | |
e93af56d | 50 | fi |
e93af56d | 51 | ;; |
52 | stop) | |
f26425db | 53 | msg_stopping IMAP |
e93af56d | 54 | killproc couriertcpd |
55 | rm -f /var/run/imapd.pid | |
56 | rm -f /var/lock/subsys/courier-imap | |
57 | ;; | |
58 | restart|reload) | |
59 | $0 stop | |
60 | $0 start | |
61 | ;; | |
62 | status) | |
63 | status couriertcpd | |
64 | ;; | |
65 | *) | |
f26425db | 66 | msg_Usage "$0 {start|stop|restart|reload|status}" |
e93af56d | 67 | exit 1 |
68 | esac | |
69 | ||
70 | exit 0 | |
71 |