Postfix error

Discussion in 'Installation/Configuration' started by dianer, Sep 19, 2005.

  1. dianer

    dianer New Member

    I get an error on restarting my server that reads:

    /etc/rc2.d/S20saslauthd: line 54: syntax error near unexpected token '('...
    when I check it, everything is identical to what appears in the perfect setup instructions.....what am i missing or doing wrong?
     
  2. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Can you post the output of
    Code:
    ls -l /etc/rc2.d
    here?
     
  3. dianer

    dianer New Member

    Yes, I can. the permissions are 777
     
  4. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Can you post the exact output here? :rolleyes:
     
  5. dianer

    dianer New Member

    I'm not sure how to copy from one machine to another to do that.
     
  6. dianer

    dianer New Member

    postfix problem

    lrwxrwxrwx 1 root root 18 2005-09-18 16:15 S10sysklogd -> ../init.d/sysklogd
    lrwxrwxrwx 1 root root 15 2005-09-18 16:15 S11klogd -> ../init.d/klogd
    lrwxrwxrwx 1 root root 13 2005-09-18 16:14 S14ppp -> ../init.d/ppp
    lrwxrwxrwx 1 root root 15 2005-09-18 20:55 S15bind9 -> ../init.d/bind9
    lrwxrwxrwx 1 root root 17 2005-09-18 20:36 S18portmap -> ../init.d/portmap
    lrwxrwxrwx 1 root root 22 2005-09-18 20:38 S19spamassassin -> ../init.d/spamassassin
    lrwxrwxrwx 1 root root 20 2005-09-18 21:47 S20courier-authdaemon -> ../init.d/courier-authdaemon
    lrwxrwxrwx 1 root root 22 2005-09-18 21:47 S20courier-imap -> ../init.d/courier-imap
    lrwxrwxrwx 1 root root 26 2005-09-18 21:47 S20courier-imap-ssl -> ../init.d/courier-imap-ssl
    lrwxrwxrwx 1 root root 21 2005-09-18 21:47 S20courier-pop -> ../init.d/courier-pop
    lrwxrwxrwx 1 root root 25 2005-09-18 21:47 S20courier-pop-ssl -> ../init.d/courier-pop-ssl
    lrwxrwxrwx 1 root root 15 2005-09-18 16:14 S20exim4 -> ../init.d/exim4
    lrwxrwxrwx 1 root root 15 2005-09-18 16:14 S20inetd -> ../init.d.inetd
    lrwxrwxrwx 1 root root 13 2005-09-18 20:36 S20lpd -> ../init.d/lpd
    lrwxrwxrwx 1 root root 17 2005-09-18 16:13 S20makedev -> ../init.d/makedev
    lrwxrwxrwx 1 root root 15 2005-09-18 21:05 S20mysql -> ../init.d/mysql
    lrwxrwxrwx 1 root root 17 2005-09-18 21:16 S20postfix -> ../init.d/postfix
    lrwxrwxrwx 1 root root 19 2005-09-18 21:16 S20saslauthd -> ../init.d/saslauthd
    lrwxrwxrwx 1 root root 13 2005-09-18 20:37 S20ssh -> ../init.d/ssh
    lrwxrwxrwx 1 root root 20 2005-09-18 20:36 S21nfs-common -> ../init.d/nfs-common
    lrwxrwxrwx 1 root root 18 2005-09-18 20:51 S21quotarpc -> ../init.d/quotarpc
    lrwxrwxrwx 1 root root 17 2005-09-18 22:08 S50proftpd -> ../init.d/proftpd
    lrwxrwxrwx 1 root root 13 2005-09-18 16:15 S89atd -> ../init.d/atd
    lrwxrwxrwx 1 root root 14 2005-09-18 16:14 S89cron -> ../init.d/cron
    lrwxrwxrwx 1 root root 17 2005-09-18 21:51 S91apache2 -> ../init.d/apache2
    lrwxrwxrwx 1 root root 19 2005-09-18 20:47 S99fetchmail -> ../init.d/fetchmail
    lrwxrwxrwx 1 root root 19 2005-09-18 16:13 S99rmnologin -> ../init.d/rmologin
    lrwxrwxrwx 1 root root 23 2005-09-18 16:13 S99stop-boodlogd -> ../init.d/stop-bootlogd
     
  7. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Looks ok. Can you now post /etc/init.d/saslauthd here?
     
  8. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    If you use putty as SSH client, simply mark the text with the cursor, open this forum in your webbrowser, right click in the editor window and chose paste.
     
  9. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Umm, that's already been posted... :rolleyes:
     
  10. dranieri

    dranieri New Member

    Apology

    Sorry getting very frustrating following what we are supposed to and only comming up against walls. My apologies.
     
  11. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    No problem. Can you post your /etc/init.d/saslauthd here?

    BTW, you can use WinSCP ( http://winscp.net/eng/index.php ) to copy files to and from your Linux box, so you can copy /etc/init.d/saslauthd to your Windows desktop, open it in a text editor and post the contents here.
     
  12. dranieri

    dranieri New Member

    Re:


    #!/bin/sh -e
    NAME=saslauthd

    DAEMON="/usr/sbin/${NAME}"

    DESC="SASL Authentication Daemon"

    DEFAULTS=/etc/default/saslauthd

    PWDIR="/var/spool/postfix/var/run/${NAME}"

    PIDFILE="${PWDIR}/saslauthd.pid"

    dir="root sasl 755 ${PWDIR}

    createdir() {

    # $1 = user

    # $2 = group

    # $3 = permissions (octal)

    # $4 = path to directory

    [ -d "$4" ] || mkdir -p "$4"

    chown -c -h "$1:$2" "$4"

    file "/etc/init.d/saslauthd", 88 lines

     
  13. dranieri

    dranieri New Member

    Re:

    Am comfortable using putty to copy and paste the information you need. Thanks for the information will keep on file.
     
  14. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Can you post the whole file here?
     
  15. dianer

    dianer New Member

    This is what we get:


    #!/bin/sh -e

    NAME=saslauthd
    DAEMON="/usr/sbin/${NAME}"
    DESC="SASL Authentication Daemon"
    DEFAULTS=/etc/default/saslauthd
    PWDIR="/var/spool/postfix/var/run/${NAME}"
    PIDFILE="${PWDIR}/saslauthd.pid"
    dir="root sasl 755 ${PWDIR}

    createdir() {
    # $1 = user
    # $2 = group
    # $3 = permissions (octal)
    # $4 = path to directory
    [ -d "$4" ] || mkdir -p "$4"
    chown -c -h "$1:$2" "$4"
    chmod -c "$3" "$4"
    }

    test -f "${DAEMON}" || exit 0

    # Source defaults file; edit that file to configure this script.
    :
     
  16. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    That's not the whole file. If you use the sreen up and screen down keys you'll see that there's more in that file. Try to use the WinSCP solution that I proposed to you.
     
  17. dianer

    dianer New Member

    Postfix

    I will do that...I've got to leave for work, I will do that when I get home....thanks
     
  18. dianer

    dianer New Member

    #!/bin/sh -e

    NAME=saslauthd
    DAEMON="/usr/sbin/${NAME}"
    DESC="SASL Authentication Daemon"
    DEFAULTS=/etc/default/saslauthd
    PWDIR="/var/spool/postfix/var/run/${NAME}"
    PIDFILE="${PWDIR}/saslauthd.pid"
    dir="root sasl 755 ${PWDIR}

    createdir() {
    # $1 = user
    # $2 = group
    # $3 = permissions (octal)
    # $4 = path to directory
    [ -d "$4" ] || mkdir -p "$4"
    chown -c -h "$1:$2" "$4"
    chmod -c "$3" "$4"
    }

    test -f "${DAEMON}" || exit 0

    # Source defaults file; edit that file to configure this script.
    if [ -e "${DEFAULTS}" ]; then
    . "${DEFAULTS}"
    fi

    # If we're not to start the daemon, simply exit
    if [ "${START}" != "yes" ]; then
    exit 0
    fi

    # If we have no mechanisms defined
    if [ "x${MECHANISMS}" = "x" ]; then
    echo "You need to configure ${DEFAULTS} with mechanisms to be used"
    exit 0
    fi

    # Add our mechanimsms with the necessary flag
    PARAMS="${PARAMS} -a ${MECHANISMS}"

    START="--start --quiet --pidfile ${PIDFILE} --startas ${DAEMON} --name ${NAME} -- ${PARAMS}"

    # Consider our options
    case "${1}" in
    start)
    echo -n "Starting ${DESC}: "
    #dir=`dpkg-statoverride --list $PWDIR`
    test -z "$dir" || createdir $dir
    if start-stop-daemon ${START} >/dev/null 2>&1 ; then
    echo "${NAME}."
    else
    if start-stop-daemon --test ${START} >/dev/null 2>&1; then
    echo "(failed)."
    exit 1
    else

    echo "${DAEMON} already running."
    exit 0
    fi
    fi
    ;;
    stop)
    echo -n "Stopping ${DESC}: "
    if start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" \
    --startas ${DAEMON} --retry 10 --name ${NAME} \
    >/dev/null 2>&1 ; then
    echo "${NAME}."
    else
    if start-stop-daemon --test ${START} >/dev/null 2>&1; then
    echo "(not running)."
    exit 0
    else
    echo "(failed)."
    exit 1
    fi
    fi
    ;;
    restart|force-reload)
    $0 stop
    exec $0 start
    ;;
    *)
     
  19. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    /etc/init.d/saslauthd contains errors. Please delete /etc/init.d/saslauthd:
    Code:
    rm -f /etc/init.d/saslauthd
    Then create a new one that has the exactly same contents as the one in http://www.howtoforge.com/perfect_setup_debian_sarge. I also post it here:

    Code:
    #!/bin/sh -e
    
    NAME=saslauthd
    DAEMON="/usr/sbin/${NAME}"
    DESC="SASL Authentication Daemon"
    DEFAULTS=/etc/default/saslauthd
    PWDIR="/var/spool/postfix/var/run/${NAME}"
    PIDFILE="${PWDIR}/saslauthd.pid"
    dir="root sasl 755 ${PWDIR}"
    
    createdir() {
    # $1 = user
    # $2 = group
    # $3 = permissions (octal)
    # $4 = path to directory
            [ -d "$4" ] || mkdir -p "$4"
            chown -c -h "$1:$2" "$4"
            chmod -c "$3" "$4"
    }
    
    test -f "${DAEMON}" || exit 0
    
    # Source defaults file; edit that file to configure this script.
    if [ -e "${DEFAULTS}" ]; then
        . "${DEFAULTS}"
    fi
    
    # If we're not to start the daemon, simply exit
    if [ "${START}" != "yes" ]; then
        exit 0
    fi
    
    # If we have no mechanisms defined
    if [ "x${MECHANISMS}" = "x" ]; then
        echo "You need to configure ${DEFAULTS} with mechanisms to be used"
        exit 0
    fi
    
    # Add our mechanimsms with the necessary flag
    PARAMS="${PARAMS} -a ${MECHANISMS}"
    
    START="--start --quiet --pidfile ${PIDFILE} --startas ${DAEMON} --name ${NAME} -- ${PARAMS}"
    
    # Consider our options
    case "${1}" in
      start)
            echo -n "Starting ${DESC}: "
            #dir=`dpkg-statoverride --list $PWDIR`
            test -z "$dir" || createdir $dir
            if start-stop-daemon ${START} >/dev/null 2>&1 ; then
                    echo "${NAME}."
            else
                    if start-stop-daemon --test ${START} >/dev/null 2>&1; then
                            echo "(failed)."
                            exit 1
                    else
                            echo "${DAEMON} already running."
                            exit 0
                    fi
            fi
            ;;
      stop)
            echo -n "Stopping ${DESC}: "
            if start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" \
                    --startas ${DAEMON} --retry 10 --name ${NAME} \
                    >/dev/null 2>&1 ; then
                            echo "${NAME}."
            else
                    if start-stop-daemon --test ${START} >/dev/null 2>&1; then
                            echo "(not running)."
                            exit 0
                    else
                            echo "(failed)."
                            exit 1
                    fi
            fi
            ;;
      restart|force-reload)
              $0 stop
            exec $0 start
            ;;
      *)
            echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2
            exit 1
            ;;
    esac
    
    exit 0
    Then run
    Code:
    chmod 755 /etc/init.d/saslauthd
    /etc/init.d/saslauthd start
     
  20. Bouncy

    Bouncy New Member

    Hi, I am having the same probelm, I have tryed the config that you have pasted on the forums and still have SASL Authentication Deamon: (failed).

    If there are any reasons you could think of that would be great.
    just to make it easyer here is my /etc/init.d/saslauthd
    Code:
    #!/bin/sh -e
    
    NAME=saslauthd
    DAEMON="/usr/sbin/${NAME}"
    DESC="SASL Authentication Daemon"
    DEFAULTS=/etc/default/saslauthd
    PWDIR="/var/spool/postfix/var/run/${NAME}"
    PIDFILE="${PWDIR}/saslauthd.pid"
    dir="root sasl 755 ${PWDIR}"
    
    createdir() {
    # $1 = user
    # $2 = group
    # $3 = permissions (octal)
    # $4 = path to directory
    [ -d "$4" ] || mkdir -p "$4"
    chown -c -h "$1:$2" "$4"
    chmod -c "$3" "$4"
    }
    
    test -f "${DAEMON}" || exit 0
    
    # Source defaults file; edit that file to configure this script.
    if [ -e "${DEFAULTS}" ]; then
    . "${DEFAULTS}"
    fi
    
    # If we're not to start the daemon, simply exit
    if [ "${START}" != "yes" ]; then
    exit 0
    fi
    
    # If we have no mechanisms defined
    if [ "x${MECHANISMS}" = "x" ]; then
    echo "You need to configure ${DEFAULTS} with mechanisms to be used"
    exit 0
    fi
    
    # Add our mechanimsms with the necessary flag
    PARAMS="${PARAMS} -a ${MECHANISMS}"
    
    START="--start --quiet --pidfile ${PIDFILE} --startas ${DAEMON} --name ${NAME} -- ${PARAMS}"
    
    # Consider our options
    case "${1}" in
    start)
    echo -n "Starting ${DESC}: "
    #dir=`dpkg-statoverride --list $PWDIR`
    test -z "$dir" || createdir $dir
    if start-stop-daemon ${START} >/dev/null 2>&1 ; then
    echo "${NAME}."
    else
    if start-stop-daemon --test ${START} >/dev/null 2>&1; then
    echo "(failed)."
    exit 1
    else
    echo "${DAEMON} already running."
    exit 0
    fi
    fi
    ;;
    stop)
    echo -n "Stopping ${DESC}: "
    if start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" \
    --startas ${DAEMON} --retry 10 --name ${NAME} \
    >/dev/null 2>&1 ; then
    echo "${NAME}."
    else
    if start-stop-daemon --test ${START} >/dev/null 2>&1; then
    echo "(not running)."
    exit 0
    else
    echo "(failed)."
    exit 1
    fi
    fi
    ;;
    restart|force-reload)
    $0 stop
    exec $0 start
    ;;
    *)
    echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2
    exit 1
    ;;
    esac
    
    exit 0
    
     

Share This Page