SOURCES: courier-imap-ssl.init (NEW), courier-imap.init - pldize e...
arekm
arekm at pld-linux.org
Thu Sep 1 16:05:25 CEST 2005
Author: arekm Date: Thu Sep 1 14:05:25 2005 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- pldize even more; split ssl daemon starting into separate init script
---- Files affected:
SOURCES:
courier-imap-ssl.init (NONE -> 1.1) (NEW), courier-imap.init (1.18 -> 1.19)
---- Diffs:
================================================================
Index: SOURCES/courier-imap-ssl.init
diff -u /dev/null SOURCES/courier-imap-ssl.init:1.1
--- /dev/null Thu Sep 1 16:05:25 2005
+++ SOURCES/courier-imap-ssl.init Thu Sep 1 16:05:20 2005
@@ -0,0 +1,71 @@
+#!/bin/sh
+# IMAP SSL Daemon
+#
+# chkconfig: 345 80 20
+# description: IMAP SSL Daemon
+
+sysconfdir=@sysconfdir@
+libexecdir=@libexecdir@
+sbindir=@sbindir@
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+ if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+ msg_network_down imapd-ssl
+ exit 1
+ fi
+else
+ exit 0
+fi
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ # Check if the service is already running?
+ if [ ! -f /var/lock/subsys/courier-imap-ssl ]; then
+ if [ -x "$COURIERTLS" -a ! -f "$TLS_CERTFILE" ]; then
+ msg_starting "imapd-ssl cert generation"
+ daemon $sbindir/mkimapdcert
+ fi
+ . $sysconfdir/imapd-ssl
+ msg_starting imapd-ssl
+ daemon $libexecdir/imapd-ssl.rc start
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/courier-imap-ssl
+ else
+ msg_already_running imapd-ssl
+ fi
+ ;;
+ stop)
+ if [ -f /var/lock/subsys/courier-imap-ssl ]; then
+ . $sysconfdir/imapd-ssl
+ msg_stopping imapd-ssl
+ daemon $libexecdir/imapd-ssl.rc stop
+ RETVAL=$?
+ rm -f /var/lock/subsys/courier-imap-ssl >/dev/null 2>&1
+ else
+ msg_not_running imapd-ssl
+ fi
+ ;;
+ restart|force-reload)
+ $0 stop
+ $0 start
+ exit $?
+ ;;
+ status)
+ status couriertcpd
+ exit $?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|force-reload|status}"
+ exit 3
+esac
+
+exit $RETVAL
================================================================
Index: SOURCES/courier-imap.init
diff -u SOURCES/courier-imap.init:1.18 SOURCES/courier-imap.init:1.19
--- SOURCES/courier-imap.init:1.18 Thu Jul 8 17:01:10 2004
+++ SOURCES/courier-imap.init Thu Sep 1 16:05:20 2005
@@ -30,86 +30,24 @@
start)
# Check if the service is already running?
if [ ! -f /var/lock/subsys/courier-imap ]; then
-
- IMAPDSTART=""
- IMAPDSSLSTART=""
-
- if test -f $sysconfdir/imapd
- then
- . $sysconfdir/imapd
- fi
-
- case x$IMAPDSTART in
- x[yY]*)
- # Start daemons.
- msg_starting imapd
- $libexecdir/imapd.rc start
- RETVAL=$?
- if [ $RETVAL -eq 0 ]; then ok; else fail; fi
- ;;
- esac
-
- if test -f $sysconfdir/imapd-ssl
- then
- . $sysconfdir/imapd-ssl
- fi
-
- case x$IMAPDSSLSTART in
- x[yY]*)
- if test -x $COURIERTLS
- then
- # First time we start this, generate a dummy SSL certificate.
- if test ! -f $TLS_CERTFILE
- then
- echo -n " generating-SSL-certificate..."
- $sbindir/mkimapdcert >/dev/null 2>&1
- fi
- msg_starting imapd-ssl
- $libexecdir/imapd-ssl.rc start
- RETVAL=$?
- if [ $RETVAL -eq 0 ]; then ok; else fail; fi
-
- fi
- ;;
- esac
-
- touch /var/lock/subsys/courier-imap
+ . $sysconfdir/imapd
+ msg_starting imapd
+ daemon $libexecdir/imapd.rc start
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/courier-imap
else
- msg_already_running "Courier IMAP"
+ msg_already_running imapd
fi
- ;;
+ ;;
stop)
if [ -f /var/lock/subsys/courier-imap ]; then
-
- . $sysconfdir/imapd
- if [ -f $PIDFILE ]; then
- msg_stopping imapd
- $libexecdir/imapd.rc stop
- RETVAL=$?
- if [ $RETVAL -eq 0 ]; then
- ok
- rm -f $PIDFILE
- else
- fail
- fi
- fi
-
- . $sysconfdir/imapd-ssl
- if [ -f $SSLPIDFILE ]; then
- msg_stopping imapd-ssl
- $libexecdir/imapd-ssl.rc stop
- RETVAL=$?
- if [ $RETVAL -eq 0 ]; then
- ok
- rm -f $SSLPIDFILE
- else
- fail
- fi
- fi
-
- rm -f /var/lock/subsys/courier-imap
+ . $sysconfdir/imapd
+ msg_stopping imapd
+ daemon $libexecdir/imapd.rc stop
+ RETVAL=$?
+ rm -f /var/lock/subsys/courier-imap >/dev/null 2>&1
else
- msg_not_running "Courier IMAP"
+ msg_not_running imapd
fi
;;
restart|force-reload)
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SOURCES/courier-imap.init?r1=1.18&r2=1.19&f=u
More information about the pld-cvs-commit
mailing list