我這樣參數對嗎SPAMDOPTIONS="-d -c -u spamd -H /home/spamd -m5 -H"
vi /etc/rc.d/init.d/spamd 其中SPAMDOPTIONS參數設置對嗎
SPAMDOPTIONS="-d -c -u spamd -H /home/spamd -m5 -H"
我一起動就抱錯,那位大哥指點我一下,報錯如下
# /etc/rc.d/init.d/spamd start
Starting spamd: warn: Unknown option: a
Usage:
spamd
Options:
-l, --allow-tell Allow learning/reporting
-c, --create-prefs Create user preferences files
-C path, --configpath=path Path for default config files
--siteconfigpath=path Path for site configs
-d, --daemonize Daemonize
-h, --help Print usage message.
-i , --listen-ip=ipaddr Listen on the IP ipaddr
-p port, --port=port Listen on specified port
-m num, --max-children=num Allow maximum num children
--min-children=num Allow minimum num children
--min-spare=num Lower limit for number of spare children
--max-spare=num Upper limit for number of spare children
--max-conn-per-child=num Maximum connections accepted by child
before it is respawned
--round-robin Use traditional prefork algorithm
--timeout-tcp=secs Connection timeout for client headers
--timeout-child=secs Connection timeout for message checks
-q, --sql-config Enable SQL config (only useful with -x)
-Q, --setuid-with-sql Enable SQL config (only useful with -x,
enables use of -H)
--ldap-config Enable LDAP config (only useful with -x)
--setuid-with-ldap Enable LDAP config (only useful with -x,
enables use of -H)
--virtual-config-dir=dir Enable pattern based Virtual configs
(needs -x)
-r pidfile, --pidfile Write the process id to pidfile
-s facility, --syslog=facility Specify the syslog facility
--syslog-socket=type How to connect to syslogd
-u username, --username=username Run as username
-v, --vpopmail Enable vpopmail config
-x, --nouser-config Disable user config files
--auth-ident Use ident to authenticate spamc user
--ident-timeout=timeout Timeout for ident connections
-A host,..., --allowed-ips=..,.. Limit ip addresses which can connect
-D, --debug[=areas] Print debugging messages (for areas)
-L, --local Use local tests only (no DNS)
-P, --paranoid Die upon user errors
-H , --helper-home-dir[=dir] Specify a different HOME directory
--ssl Run an SSL server
--server-key keyfile Specify an SSL keyfile
--server-cert certfile Specify an SSL certificate
--socketpath=path Listen on given UNIX domain socket
--socketowner=name Set UNIX domain socket file's owner
--socketgroup=name Set UNIX domain socket file's group
--socketmode=mode Set UNIX domain socket file's mode
《解決方案》
以上報錯的配置文件如下
#!/bin/sh
#
# spamassassin This script starts and stops the spamd daemon
#
# chkconfig: - 80 30
# processname: spamd
# description: spamd is a daemon process which uses SpamAssassin to check \
# email messages for SPAM. It is normally called by spamc \
# from a MDA.
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
# Set default spamd configuration.
SPAMDOPTIONS="-d -c -u spamd -H /home/spamd -m5"
# Source spamd configuration.
if [ -f /etc/sysconfig/spamassassin ] ; then
. /etc/sysconfig/spamassassin
fi
[ -f /usr/bin/spamd -o -f /usr/local/bin/spamd ] || exit 0
PATH=$PATH:/usr/bin:/usr/local/bin
# By default it's all good
RETVAL=0
# See how we were called.
case "$1" in
start)
# Start daemon.
echo -n "Starting spamd: "
daemon $NICELEVEL spamd $SPAMDOPTIONS
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/spamassassin
;;
stop)
# Stop daemons.
echo -n "Shutting down spamd: "
killproc spamd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/spamassassin
;;
restart)
$0 stop
$0 start
;;
condrestart)
[ -e /var/lock/subsys/spamassassin ] && $0 restart
;;
status)
status spamd
RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|restart|status|condrestart}"
RETVAL=1
;;
esac
exit $RETVAL