• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 735
  • Last Modified:

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

0
ryan80
Asked:
ryan80
  • 4
  • 4
1 Solution
 
wesly_chenCommented:
As root
# find / -name "rsyslog.conf" | xargs egrep -v ^#

And post the output of the command above here.
0
 
wesly_chenCommented:
Please run this instead:
# find / -name "rsyslog.conf" | xargs egrep -v ^$
0
 
ryan80Author Commented:
Ok, I will get that tomorrow. Is the setting supposed to be in the rsyslog.conf or in /etc/rd.0/init.d/rsyslog ?
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
wesly_chenCommented:
Please also post /etc/rd.0/init.d/rsyslog
0
 
ryan80Author Commented:
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

0
 
ryan80Author Commented:
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

0
 
wesly_chenCommented:
in /etc/rc.d/init.d/rsyslog
----------
...
RETVAL=0
PIDFILE=/var/run/rsyslogd.pid
$SYSLOGD_OPTIONS='-c 3'    #<====Add this line
...
0
 
ryan80Author Commented:
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.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now