X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=courier-imap-pop3.init;h=dbda27c1f11c8d924136a5e32089b793135ba6f6;hb=d94a48a070ba8aa9785fa5b3a4a498f5c0c0586d;hp=e1cc2b837e3069905bd9a464b713186fca94cf64;hpb=ac84c9b536f61dcb92d8b8e0dae2b3eaa736db75;p=packages%2Fcourier-imap.git diff --git a/courier-imap-pop3.init b/courier-imap-pop3.init index e1cc2b8..dbda27c 100644 --- a/courier-imap-pop3.init +++ b/courier-imap-pop3.init @@ -4,114 +4,86 @@ # chkconfig: 345 80 20 # description: POP3 Daemon +sysconfdir=@sysconfdir@ +libexecdir=@libexecdir@ +sbindir=@sbindir@ + # Source function library . /etc/rc.d/init.d/functions # Get network config . /etc/sysconfig/network -ADDRESS=0.0.0.0 -MAXPERIP=4 -MAXDAEMONS=40 -MAILDIR="Maildir" -TCPDOPTS= -POP3DSSLSTART="no" - # Get service config [ -f /etc/sysconfig/courier-pop3 ] && . /etc/sysconfig/courier-pop3 # 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 "Courier POP3" + msg_network_down "Courier POP3D" exit 1 fi else exit 0 fi -RETVAL=0 -# See how we were called. -case "$1" in - start) +start() { # Check if the service is already running? + if [ -f /var/lock/subsys/courier-pop3 ]; then + msg_already_running "Courier POP3D" + return + fi + + msg_starting "Courier POP3D" + daemon $libexecdir/pop3d.rc start + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/courier-pop3 +} + +stop() { if [ ! -f /var/lock/subsys/courier-pop3 ]; then - # start authdaemon, if not running.. - if [ ! -f /var/lock/subsys/authdaemon -a \ - -x /etc/rc.d/init.d/authdaemon ]; then - /etc/rc.d/init.d/authdaemon start - RETVAL=$? - if [ $RETVAL -ne 0 ]; then - msg_starting "Courier POP3" - fail - exit 1 - fi - fi - msg_starting "Courier POP3" - /usr/bin/env - /bin/sh -c " . /etc/sysconfig/courier-pop3 ; \ - POP3_STARTTLS=$POP3DSTARTTLS ; export POP3_STARTTLS ; \ - `sed -n '/^#/d;/=/p' /dev/null 2>&1 +} - if is_yes "$POP3DSSLSTART"; then - msg_starting "Courier POP3 (SSL)" - /usr/bin/env - /bin/sh -c " . /etc/sysconfig/courier-pop3 ; \ - POP3_TLS=1; export POP3_TLS; \ - `sed -n '/^#/d;/=/p'