View Full Version : Postfix error
dianer
19th September 2005, 05:43
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?
falko
19th September 2005, 10:15
Can you post the output of ls -l /etc/rc2.d here?
dianer
20th September 2005, 04:39
Yes, I can. the permissions are 777
falko
20th September 2005, 09:54
Can you post the exact output here? :rolleyes:
dianer
21st September 2005, 02:30
Can you post the exact output here? :rolleyes:
I'm not sure how to copy from one machine to another to do that.
dianer
21st September 2005, 04:11
Can you post the output of ls -l /etc/rc2.d here?
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
falko
21st September 2005, 10:11
Looks ok. Can you now post /etc/init.d/saslauthd here?
till
21st September 2005, 11:40
I'm not sure how to copy from one machine to another to do that.
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.
falko
21st September 2005, 17:25
Umm, that's already been posted... :rolleyes:
dranieri
21st September 2005, 17:40
Umm, that's already been posted... :rolleyes:
Sorry getting very frustrating following what we are supposed to and only comming up against walls. My apologies.
falko
21st September 2005, 22:11
Sorry getting very frustrating following what we are supposed to and only comming up against walls. My apologies.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.
dranieri
21st September 2005, 22:53
#!/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
No problem. Can you post your /etc/init.d/saslauthd here?
When typing /etc/init.d/saslauthd got this
response /etc/init.d/saslauthd: line 54: syntax error near unexpected token `('
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.
dranieri
21st September 2005, 22:55
Am comfortable using putty to copy and paste the information you need. Thanks for the information will keep on file.
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.
falko
22nd September 2005, 02:49
#!/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
Can you post the whole file here?
dianer
22nd September 2005, 03:59
Can you post the whole file here?
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.
:
falko
22nd September 2005, 10:06
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.
dianer
22nd September 2005, 16:07
I will do that...I've got to leave for work, I will do that when I get home....thanks
dianer
22nd September 2005, 17:17
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.
:
#!/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
;;
*)
falko
22nd September 2005, 19:26
/etc/init.d/saslauthd contains errors. Please delete /etc/init.d/saslauthd:
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:
#!/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 chmod 755 /etc/init.d/saslauthd
/etc/init.d/saslauthd start
Bouncy
29th November 2005, 13:32
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
#!/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
falko
29th November 2005, 19:53
Did you also execute these commands?
mkdir -p /var/spool/postfix/var/run/saslauthd
rm -fr /var/run/saslauthd
Did you also execute these commands?
mkdir -p /var/spool/postfix/var/run/saslauthd
rm -fr /var/run/saslauthd
After reboot directory /var/run/saslauthd is back there.
After reboot directory /var/run/saslauthd is back there.
Not if you modify the saslauthd init script appropriately...
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.