Link to home
Start Free TrialLog in
Avatar of ryan80
ryan80

asked on

how to get rsyslog to not start in compatibilty mode

I am setting up rsyslog for logging purposes and cannot get it to not start in compatability mode. I have read through all the documentation and know that all I need is a simple "-c 3" as an option for it not to start in compatability mode.

But I am a Linux moron and have no idea where to put it. I can start rsyslog manually and get it to run in non compatability mode, but I cant figure out where the hell to put the otion so that it will automatically start in non compatability mode.

Can anyone help me and just tell me what to put where? I am running CentOS 5.5 and rsyslog version 3

Avatar of wesly_chen
wesly_chen
Flag of United States of America image

As root
# find / -name "rsyslog.conf" | xargs egrep -v ^#

And post the output of the command above here.
Please run this instead:
# find / -name "rsyslog.conf" | xargs egrep -v ^$
Avatar of ryan80
ryan80

ASKER

Ok, I will get that tomorrow. Is the setting supposed to be in the rsyslog.conf or in /etc/rd.0/init.d/rsyslog ?
Please also post /etc/rd.0/init.d/rsyslog
Avatar of ryan80

ASKER

Here is the rsyslog.conf
#mysql database connection - 

$ModLoad ommysql
*.*       :ommysql:127.0.0.1,syslog,rsyslog_user,password

#$template sysMysql,"INSERT INTO logs (host,facility, priority,level,tag,datetime,program,msg) VALUES ('%HOSTNAME%','%syslogfacility%','%syslogpriority% ','%syslogseverity%','%syslogtag%', '%timereported:::date-mysql%', '%programname%', '%msg%')", SQL

# for UDP use:

$modload imudp

$UDPServerRun 514

# Use traditional timestamp format
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

# Provides kernel logging support (previously done by rklogd)
$ModLoad imklog
# Provides support for local system logging (e.g. via logger command)
$ModLoad imuxsock

# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.*                                                 /dev/console

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none                /var/log/messages

# The authpriv file has restricted access.
authpriv.*                                              /var/log/secure

# Log all the mail messages in one place.
mail.*                                                  -/var/log/maillog


# Log cron stuff
cron.*                                                  /var/log/cron

# Everybody gets emergency messages
*.emerg                                                 *

# Save news errors of level crit and higher in a special file.
uucp,news.crit                                          /var/log/spooler

# Save boot messages also to boot.log
local7.*                                                /var/log/boot.log

Open in new window

Avatar of ryan80

ASKER

here is the /etc/rc.d/init.d/rsyslog
#!/bin/bash
#
# rsyslog        Starts rsyslogd/rklogd.
#
#
# chkconfig: - 12 88
# description: Syslog is the facility by which many daemons use to log \
# messages to various system log files.  It is a good idea to always \
# run rsyslog.
### BEGIN INIT INFO
# Provides: $syslog
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $network $remote_fs
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: Enhanced system logging and kernel message trapping daemons
# Description: Rsyslog is an enhanced multi-threaded syslogd supporting,
#              among others, MySQL, syslog/tcp, RFC 3195, permitted
#              sender lists, filtering on any message part, and fine
#              grain output format control.
### END INIT INFO

# Source function library.
. /etc/init.d/functions

RETVAL=0
PIDFILE=/var/run/rsyslogd.pid

prog=rsyslogd
exec=/sbin/rsyslogd
lockfile=/var/lock/subsys/$prog

start() {
        [ -x $exec ] || exit 5

        # Do not start rsyslog when sysklogd is running
        if [ -e /var/run/syslogd.pid ] ; then
                echo $"Shut down sysklogd before you run rsyslog";
                exit 1;
        fi

        # Source config
        if [ -f /etc/sysconfig/rsyslog ] ; then
                . /etc/sysconfig/rsyslog
        fi

        if [ -z "$SYSLOG_UMASK" ] ; then
              SYSLOG_UMASK=077;
        fi
        umask $SYSLOG_UMASK

        echo -n $"Starting system logger: "
        daemon $exec $SYSLOGD_OPTIONS
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch $lockfile
        return $RETVAL
}
stop() {
        echo -n $"Shutting down system logger: "
        killproc $prog
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f $lockfile
        return $RETVAL
}
reload()  {
    RETVAL=1
    syslog=$(cat "${PIDFILE}" 2>/dev/null)
    echo -n "Reloading system logger..."
    if [ -n "${syslog}" ] && [ -e /proc/"${syslog}" ]; then
        kill -HUP "$syslog";
        RETVAL=$?
    fi
    if [ $RETVAL -ne 0 ]; then
        failure
    else
        success
    fi
    echo
    return $RETVAL
}
rhstatus() {
        status -p "${PIDFILE}" $prog
}
restart() {
        stop
        start
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  reload|force-reload)
        reload
        ;;
  status)
        rhstatus
        ;;
  condrestart|try-restart)
        rhstatus >/dev/null 2>&1 || exit 0
        restart
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart|condrestart|try-restart|reload|force-reload|status}"
        exit 2
esac

exit $?

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of wesly_chen
wesly_chen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ryan80

ASKER

Thanks,

I knew that it was something in there, but every time I tried to modify something, I broke the service entirely.

I dropped off the preceding $ and it works great.