Thanks for the help, guys. I tried what you said, Robert, found and fixed a syntax error in my configuration file due to a missing semi-colon, and got the log files I wanted. Starting the syslog-ng daemon via the script /etc/init.d/syslog-ng still caused the syslog-ng daemon to create logs with the old configuration (ending in .txt etc.), so I changed the script from calling syslog-ng with no parameters to calling syslog-ng with the parameter -f /etc/syslog-ng/syslog-ng.conf. I'm getting the result I want now.
However, I'm still curious as to how I managed to pick up the wrong configuration in the first place ,and why explicitly specifying the config file path was necessary, because the man page claims that /etc/syslog-ng/syslog-ng.conf is the default configuration file location.
My /etc/init.d/syslog-ng script is as follows:
Code:
#!/bin/sh
#
# syslog-ng Starts syslog-ng/klogd
#
# chkconfig: 2345 12 88
# description: syslog-ng (Replacement for Linux syslog daemon)
### BEGIN INIT INFO
# Provides: $syslog-ng
### END INIT INFO
# full path to daemon
INIT_PROG="/usr/local/sbin/syslog-ng"
INIT_NAME=`basename "$INIT_PROG"`
# Source function library
. /etc/rc.d/init.d/functions
[ -f /usr/local/sbin/syslog-ng ] || exit 0
[ -f /sbin/klogd ] || exit 0
# Source config
if [ -f /etc/sysconfig/syslog-ng ] ; then
. /etc/sysconfig/syslog-ng;
else
SYSLOGNG_OPTIONS=""
KLOGD_OPTIONS="-2"
fi
RETVAL=0
umask 077
start() {
echo -n $"Starting $INIT_NAME: "
daemon $INIT_PROG $SYSLOGNG_OPTIONS
RETVAL=$?
echo
echo -n "Starting kernel logger: "
daemon klogd $KLOGD_OPTIONS
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/syslog
return $RETVAL
}
stop() {
echo -n $"Shutting down kernel logger: "
killproc klogd
echo
echo -n $"Shutting down $INIT_NAME: "
killproc $INIT_PROG
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$INIT_NAME
return $RETVAL
}
rhstatus() {
status $INIT_PROG
status klogd
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
rhstatus
;;
restart|reload)
restart
;;
condrestart)
[ -f /var/lock/subsys/$INIT_PROG ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
exit 1
esac
exit $?
and my /etc/sysconfig/syslog-ng script was:
Code:
# Options to syslog-ng
# See syslog-ng(8) for more details
SYSLOGNG_OPTIONS=""
# Options to klogd
# -2 prints all kernel oops messages twice; once for klogd to decode, and
# once for processing with 'ksymoops'
# -x disables all klogd processing of oops messages entirely
# See klogd(8) for more details
KLOGD_OPTIONS="-x"
and is now:
Code:
# Options to syslog-ng
# See syslog-ng(8) for more details
SYSLOGNG_OPTIONS="-f /etc/syslog-ng/syslog-ng.conf"
# Options to klogd
# -2 prints all kernel oops messages twice; once for klogd to decode, and
# once for processing with 'ksymoops'
# -x disables all klogd processing of oops messages entirely
# See klogd(8) for more details
KLOGD_OPTIONS="-x"
I reiterate that I've got the result I want now (thanks again), and am just asking for help in understanding the scripts and so forth a little better.