]> git.pld-linux.org Git - packages/courier-imap.git/blame - courier-imap-pop3.init
- myownquery.patch - new release (major updates at triggering functions)
[packages/courier-imap.git] / courier-imap-pop3.init
CommitLineData
1986fe76 1#!/bin/sh
0e7557ae 2# POP3 Daemon
1986fe76 3#
4# chkconfig: 345 80 20
0e7557ae 5# description: POP3 Daemon
1986fe76 6
7# Source function library
8. /etc/rc.d/init.d/functions
9
10# Get network config
11. /etc/sysconfig/network
12
13ADDRESS=0.0.0.0
14MAXPERIP=4
15MAXDAEMONS=40
16MAILDIR="Maildir"
17TCPDOPTS=
18POP3DSSLSTART="no"
19
20# Get service config
0e7557ae 21[ -f /etc/sysconfig/courier-pop3 ] && . /etc/sysconfig/courier-pop3
1986fe76 22
23# Check that networking is up.
24if is_no "${NETWORKING}" ; then
0e7557ae 25 msg_network_down "Courier POP3"
1986fe76 26 exit 1
27fi
28
29# See how we were called.
30case "$1" in
31 start)
32 # Check if the service is already running?
0e7557ae 33 if [ ! -f /var/lock/subsys/courier-pop3 ]; then
34 # start authdaemon, if not running..
35 if [ ! -f /var/lock/subsys/authdaemon -a \
36 -x /etc/rc.d/init.d/authdaemon ]; then
37 /etc/rc.d/init.d/authdaemon start
38 RETVAL=$?
39 if [ $RETVAL -ne 0 ]; then
40 msg_starting "Courier POP3"
41 fail
42 exit 1
43 fi
44 fi
45 msg_starting "Courier POP3"
46 /usr/bin/env - /bin/sh -c " . /etc/sysconfig/courier-pop3 ; \
1986fe76 47 POP3_STARTTLS=$POP3DSTARTTLS ; export POP3_STARTTLS ; \
0e7557ae 48 `sed -n '/^#/d;/=/p' </etc/sysconfig/courier-pop3 | \
1986fe76 49 sed 's/=.*//;s/^/export /;s/$/;/'` \
50 /usr/lib/courier-imap/couriertcpd -address=$ADDRESS \
e781919f 51 -stderrlogger=/usr/lib/courier-imap/courierlogger \
1986fe76 52 -maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP \
53 -pid=/var/run/pop3d.pid $TCPDOPTS 110 /usr/sbin/pop3login \
54 /usr/lib/courier-imap/authlib/authdaemon /usr/bin/pop3d $MAILDIR"
55 RETVAL=$?
56 if [ $RETVAL -eq 0 ]; then
57 ok
58 else
59 fail
60 fi
61
1986fe76 62
63 if is_yes "$POP3DSSLSTART"; then
0e7557ae 64 msg_starting "Courier POP3 (SSL)"
65 /usr/bin/env - /bin/sh -c " . /etc/sysconfig/courier-pop3 ; \
1986fe76 66 POP3_TLS=1; export POP3_TLS; \
0e7557ae 67 `sed -n '/^#/d;/=/p' </etc/sysconfig/courier-pop3 | \
1986fe76 68 sed 's/=.*//;s/^/export /;s/$/;/'`
69 /usr/lib/courier-imap/couriertcpd -address=$ADDRESS \
e781919f 70 -stderrlogger=/usr/lib/courier-imap/courierlogger \
1986fe76 71 -maxprocs=$MAXDAEMONS -maxperip=$MAXPERIP \
72 -pid=/var/run/pop3d-ssl.pid $TCPDOPTS \
73 995 /usr/bin/couriertls -server -tcpd \
74 /usr/sbin/pop3login /usr/lib/courier-imap/authlib/authdaemon \
75 /usr/bin/pop3d $MAILDIR"
565c584d 76 RETVAL=$?
77 if [ $RETVAL -eq 0 ]; then
78 ok
79 else
80 fail
81 fi
1986fe76 82 fi
0e7557ae 83 touch /var/lock/subsys/courier-pop3
1986fe76 84 else
0e7557ae 85 msg_already_running "Courier POP3"
1986fe76 86 exit 1
87 fi
88 ;;
89 stop)
0e7557ae 90 if [ -f /var/lock/subsys/courier-pop3 ]; then
91 msg_stopping "Courier POP3"
1986fe76 92 daemon /usr/lib/courier-imap/couriertcpd -pid=/var/run/pop3d.pid -stop
93 if is_yes "$POP3DSSLSTART"; then
0e7557ae 94 msg_stopping "Courier POP3 (SSL)"
1986fe76 95 daemon /usr/lib/courier-imap/couriertcpd -pid=/var/run/pop3d-ssl.pid -stop
96 fi
97 RETVAL=$?
0e7557ae 98 rm -f /var/lock/subsys/courier-pop3
1986fe76 99 else
0e7557ae 100 msg_not_running "Courier POP3"
1986fe76 101 exit 1
102 fi
103 ;;
104 restart|reload)
105 $0 stop
106 $0 start
107 ;;
108 status)
109 status couriertcpd
110 ;;
111 *)
7ea5697f 112 msg_usage "$0 {start|stop|restart|reload|status}"
1986fe76 113 exit 1
114esac
115
116exit $RETVAL
117
This page took 0.041123 seconds and 4 git commands to generate.