5 # description: POP3 Daemon
7 sysconfdir=@sysconfdir@
8 libexecdir=@libexecdir@
11 # Source function library
12 . /etc/rc.d/init.d/functions
15 . /etc/sysconfig/network
17 # Check that networking is up.
18 if is_yes "${NETWORKING}"; then
19 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
20 msg_network_down "Courier POP3"
28 # See how we were called.
31 # Check if the service is already running?
32 if [ ! -f /var/lock/subsys/courier-pop3 ]; then
37 if test -f $sysconfdir/pop3d
46 $libexecdir/pop3d.rc start
48 if [ $RETVAL -eq 0 ]; then ok; else fail; fi
52 if test -f $sysconfdir/pop3d-ssl
54 . $sysconfdir/pop3d-ssl
57 case x$POP3DSSLSTART in
59 if test -x $COURIERTLS
61 # First time we start this, generate a dummy SSL certificate.
62 if test ! -f $TLS_CERTFILE
64 echo -n " generating-SSL-certificate..."
65 $sbindir/mkpop3dcert >/dev/null 2>&1
67 msg_starting pop3d-ssl
68 $libexecdir/pop3d-ssl.rc start
70 if [ $RETVAL -eq 0 ]; then ok; else fail; fi
76 touch /var/lock/subsys/courier-pop3
78 msg_already_running "Courier POP3"
82 if [ -f /var/lock/subsys/courier-pop3 ]; then
85 if [ -f $PIDFILE ]; then
87 $libexecdir/pop3d.rc stop
89 if [ $RETVAL -eq 0 ]; then
97 . $sysconfdir/pop3d-ssl
98 if [ -f $SSLPIDFILE ]; then
99 msg_stopping pop3d-ssl
100 $libexecdir/pop3d-ssl.rc stop
102 if [ $RETVAL -eq 0 ]; then
110 rm -f /var/lock/subsys/courier-pop3
112 msg_not_running "Courier POP3"
115 restart|force-reload)
125 msg_usage "$0 {start|stop|restart|force-reload|status}"