From 7ca584cf3a2f00587d11fee81691667bf0d4b1a4 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 31 Mar 2008 16:29:12 +0000 Subject: bumped version number --- ChangeLog | 2 + configure.ac | 2 +- rklogd.8 | 440 ----------------------------------------------------------- 3 files changed, 3 insertions(+), 441 deletions(-) delete mode 100644 rklogd.8 diff --git a/ChangeLog b/ChangeLog index 8f3499c9..aa893f28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ --------------------------------------------------------------------------- +Version 3.15.0 (rgerhards), 2008-04-01 +--------------------------------------------------------------------------- Version 3.13.0-dev0 (rgerhards), 2008-03-31 - bugfix: accidently set debug option in 3.12.5 reset to production This option prevented dlclose() to be called. It had no real bad effects, diff --git a/configure.ac b/configure.ac index 04ec3db5..81361ef0 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([rsyslog],[3.13.0-dev0],[rsyslog@lists.adiscon.com]) +AC_INIT([rsyslog],[3.15.0],[rsyslog@lists.adiscon.com]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([syslogd.c]) AC_CONFIG_HEADERS([config.h]) diff --git a/rklogd.8 b/rklogd.8 deleted file mode 100644 index 39a0a1fa..00000000 --- a/rklogd.8 +++ /dev/null @@ -1,440 +0,0 @@ -.\" Copyright 1994 Dr. Greg Wettstein, Enjellic Systems Development. -.\" May be distributed under the GNU General Public License -.\" Sun Jul 30 01:35:55 MET: Martin Schulze: Updates -.\" Sun Nov 19 23:22:21 MET: Martin Schulze: Updates -.\" Mon Aug 19 09:42:08 CDT 1996: Dr. G.W. Wettstein: Updates -.\" -.TH RKLOGD 8 "03 JULY 2007" "Version 1.14.2 (devel)" "Linux System Administration" -.SH NAME -rklogd \- Kernel Log Daemon -.LP -.SH SYNOPSIS -.B rklogd -.RB [ " \-c " -.I n -] -.RB [ " \-d " ] -.RB [ " \-f " -.I fname -] -.RB [ " \-iI " ] -.RB [ " \-n " ] -.RB [ " \-o " ] -.RB [ " \-p " ] -.RB [ " \-s " ] -.RB [ " \-k " -.I fname -] -.RB [ " \-v " ] -.RB [ " \-x " ] -.RB [ " \-2 " ] -.LP -.SH DESCRIPTION -.B rklogd -is a system daemon which intercepts and logs Linux kernel -messages. -.LP -.SH OPTIONS -.TP -.BI "\-c " n -Sets the default log level of console messages to \fIn\fR. -.TP -.B "\-d" -Enable debugging mode. This will generate \fBLOTS\fR of output to -stderr. -.TP -.BI "\-f " file -Log messages to the specified filename rather than to the syslog facility. -.TP -.BI "\-i \-I" -Signal the currently executing rklogd daemon. Both of these switches control -the loading/reloading of symbol information. The \-i switch signals the -daemon to reload the kernel module symbols. The \-I switch signals for a -reload of both the static kernel symbols and the kernel module symbols. -.TP -.B "\-n" -Avoid auto-backgrounding. This is needed especially if the -.B rklogd -is started and controlled by -.BR init (8). -.TP -.B "-o" -Execute in 'one\-shot' mode. This causes \fBrklogd\fP to read and log -all the messages that are found in the kernel message buffers. After -a single read and log cycle the daemon exits. -.TP -.B "-p" -Enable paranoia. This option controls when rklogd loads kernel module symbol -information. Setting this switch causes rklogd to load the kernel module -symbol information whenever an Oops string is detected in the kernel message -stream. -.TP -.B "-s" -Force \fBrklogd\fP to use the system call interface to the kernel message -buffers. -.TP -.BI "\-k " file -Use the specified file as the source of kernel symbol information. -.TP -.B "\-v" -Print version and exit. -.TP -.B "\-x" -Omits EIP translation and therefore doesn't read the System.map file. -.TP -.B "\-2" -When symbols are expanded, print the line twice. Once with addresses -converted to symbols, once with the raw text. This allows external -programs such as ksymoops do their own processing on the original -data. -.LP -.SH OVERVIEW -The functionality of rklogd has been typically incorporated into other -versions of syslogd but this seems to be a poor place for it. In the -modern Linux kernel a number of kernel messaging issues such as -sourcing, prioritization and resolution of kernel addresses must be -addressed. Incorporating kernel logging into a separate process -offers a cleaner separation of services. - -In Linux there are two potential sources of kernel log information: the -.I /proc -file system and the syscall (sys_syslog) interface, although -ultimately they are one and the same. Klogd is designed to choose -whichever source of information is the most appropriate. It does this -by first checking for the presence of a mounted -.I /proc -file system. If this is found the -.I /proc/kmsg -file is used as the source of kernel log -information. If the proc file system is not mounted -.B rklogd -uses a -system call to obtain kernel messages. The command line switch -.RB ( "\-s" ) -can be used to force rklogd to use the system call interface as its -messaging source. - -If kernel messages are directed through the -.BR syslogd " daemon the " rklogd -daemon, as of version 1.1, has the ability to properly prioritize -kernel messages. Prioritization of the kernel messages was added to it -at approximately version 0.99pl13 of the kernel. The raw kernel messages -are of the form: -.IP -\<[0\-7]\>Something said by the kernel. -.PP -The priority of the kernel message is encoded as a single numeric -digit enclosed inside the <> pair. The definitions of these values is -given in the kernel include file kernel.h. When a message is received -from the kernel the rklogd daemon reads this priority level and assigns -the appropriate priority level to the syslog message. If file output -(\fB-f\fR) is used the prioritization sequence is left pre\-pended to the -kernel message. - -The -.B rklogd -daemon also allows the ability to alter the presentation of -kernel messages to the system console. Consequent with the -prioritization of kernel messages was the inclusion of default -messaging levels for the kernel. In a stock kernel the the default -console log level is set to 7. Any messages with a priority level -numerically lower than 7 (higher priority) appear on the console. - -Messages of priority level 7 are considered to be 'debug' messages and -will thus not appear on the console. Many administrators, -particularly in a multi\-user environment, prefer that all kernel -messages be handled by rklogd and either directed to a file or to -the syslogd daemon. This prevents 'nuisance' messages such as line -printer out of paper or disk change detected from cluttering the -console. - -When -.B \-c -is given on the commandline the -.B rklogd -daemon will execute a system call to inhibit all kernel messages from -being displayed on the console. Former versions always issued this -system call and defaulted to all kernel messages except for panics. -This is handled differently nowardays so -.B rklogd -doesn't need to set this value anymore. The -argument given to the \fB\-c\fR switch specifies the priority level of -messages which will be directed to the console. Note that messages of -a priority value LOWER than the indicated number will be directed to -the console. -.IP -For example, to have the kernel display all messages with a -priority level of 3 -.BR "" ( KERN_ERR ) -or more severe the following -command would be executed: -.IP -.nf - rklogd \-c 4 -.fi -.PP -The definitions of the numeric values for kernel messages are given in -the file -.IR kernel.h " which can be found in the " /usr/include/linux -directory if the kernel sources are installed. These values parallel -the syslog priority values which are defined in the file -.IR syslog.h " found in the " /usr/include/sys " sub\-directory." - -The rklogd daemon can also be used in a 'one\-shot' mode for reading the -kernel message buffers. One shot mode is selected by specifying the -\fB\-o\fR switch on the command line. Output will be directed to either the -syslogd daemon or to an alternate file specified by the \fB-f\fR switch. -.IP -For example, to read all the kernel messages after a system -boot and record them in a file called krnl.msg the following -command would be given. -.IP -.nf - rklogd -o -f ./krnl.msg -.fi -.PP -.SH KERNEL ADDRESS RESOLUTION -If the kernel detects an internal error condition a general protection -fault will be triggered. As part of the GPF handling procedure the -kernel prints out a status report indicating the state of the -processor at the time of the fault. Included in this display are the -contents of the microprocessor's registers, the contents of the kernel -stack and a tracing of what functions were being executed at the time -of the fault. - -This information is -.B EXTREMELY IMPORTANT -in determining what caused the internal error condition. The -difficulty comes when a kernel developer attempts to analyze this -information. The raw numeric information present in the protection -fault printout is of very little use to the developers. This is due -to the fact that kernels are not identical and the addresses of -variable locations or functions will not be the same in all kernels. -In order to correctly diagnose the cause of failure a kernel developer -needs to know what specific kernel functions or variable locations -were involved in the error. - -As part of the kernel compilation process a listing is created which -specified the address locations of important variables and function in -the kernel being compiled. This listing is saved in a file called -System.map in the top of the kernel directory source tree. Using this -listing a kernel developer can determine exactly what the kernel was -doing when the error condition occurred. - -The process of resolving the numeric addresses from the protection -fault printout can be done manually or by using the -.B ksymoops -program which is included in the kernel sources. - -As a convenience -.B rklogd -will attempt to resolve kernel numeric addresses to their symbolic -forms if a kernel symbol table is available at execution time. If you -require the original address of the symbol, use the -.B -2 -switch to preserve the numeric address. A -symbol table may be specified by using the \fB\-k\fR switch on the -command line. If a symbol file is not explicitly specified the -following filenames will be tried: - -.nf -.I /boot/System.map -.I /System.map -.I /usr/src/linux/System.map -.fi - -Version information is supplied in the system maps as of kernel -1.3.43. This version information is used to direct an intelligent -search of the list of symbol tables. This feature is useful since it -provides support for both production and experimental kernels. - -For example a production kernel may have its map file stored in -/boot/System.map. If an experimental or test kernel is compiled with -the sources in the 'standard' location of /usr/src/linux the system -map will be found in /usr/src/linux/System.map. When rklogd starts -under the experimental kernel the map in /boot/System.map will be -bypassed in favor of the map in /usr/src/linux/System.map. - -Modern kernels as of 1.3.43 properly format important kernel addresses -so that they will be recognized and translated by rklogd. Earlier -kernels require a source code patch be applied to the kernel sources. -This patch is supplied with the sysrklogd sources. - -The process of analyzing kernel protections faults works very well -with a static kernel. Additional difficulties are encountered when -attempting to diagnose errors which occur in loadable kernel modules. -Loadable kernel modules are used to implement kernel functionality in -a form which can be loaded or unloaded at will. The use of loadable -modules is useful from a debugging standpoint and can also be useful -in decreasing the amount of memory required by a kernel. - -The difficulty with diagnosing errors in loadable modules is due to -the dynamic nature of the kernel modules. When a module is loaded the -kernel will allocate memory to hold the module, when the module is -unloaded this memory will be returned back to the kernel. This -dynamic memory allocation makes it impossible to produce a map file -which details the addresses of the variable and functions in a kernel -loadable module. Without this location map it is not possible for a -kernel developer to determine what went wrong if a protection fault -involves a kernel module. - -.B rklogd -has support for dealing with the problem of diagnosing protection -faults in kernel loadable modules. At program start time or in -response to a signal the daemon will interrogate the kernel for a -listing of all modules loaded and the addresses in memory they are -loaded at. Individual modules can also register the locations of -important functions when the module is loaded. The addresses of these -exported symbols are also determined during this interrogation -process. - -When a protection fault occurs an attempt will be made to resolve -kernel addresses from the static symbol table. If this fails the -symbols from the currently loaded modules are examined in an attempt -to resolve the addresses. At the very minimum this allows rklogd to -indicate which loadable module was responsible for generating the -protection fault. Additional information may be available if the -module developer chose to export symbol information from the module. - -Proper and accurate resolution of addresses in kernel modules requires -that -.B rklogd -be informed whenever the kernel module status changes. The -.B \-i -and -.B \-I -switches can be used to signal the currently executing daemon that -symbol information be reloaded. Of most importance to proper -resolution of module symbols is the -.B \-i -switch. Each time a kernel module is loaded or removed from the -kernel the following command should be executed: - -.nf -.I rklogd \-i -.fi - -The -.B \-p -switch can also be used to insure that module symbol information is up -to date. This switch instructs -.B rklogd -to reload the module symbol information whenever a protection fault -is detected. Caution should be used before invoking the program in -\'paranoid\' mode. The stability of the kernel and the operating -environment is always under question when a protection fault occurs. -Since the rklogd daemon must execute system calls in order to read the -module symbol information there is the possibility that the system may -be too unstable to capture useful information. A much better policy -is to insure that rklogd is updated whenever a module is loaded or -unloaded. Having uptodate symbol information loaded increases the -probability of properly resolving a protection fault if it should occur. - -Included in the sysrklogd source distribution is a patch to the -modules-2.0.0 package which allows the -.B insmod, -.B rmmod -and -.B modprobe -utilities to automatically signal -.B rklogd -whenever a module is inserted or removed from the kernel. Using this -patch will insure that the symbol information maintained in rklogd is -always consistent with the current kernel state. -.PP -.SH SIGNAL HANDLING -The -.B rklogd -will respond to eight signals: -.BR SIGHUP ", " SIGINT ", " SIGKILL ", " SIGTERM ", " SIGTSTP ", " -.BR SIGUSR1 ", "SIGUSR2 " and " SIGCONT ". The" -.BR SIGINT ", " SIGKILL ", " SIGTERM " and " SIGHUP -signals will cause the daemon to close its kernel log sources and -terminate gracefully. - -The -.BR SIGTSTP " and " SIGCONT -signals are used to start and stop kernel logging. Upon receipt of a -.B SIGTSTP -signal the daemon will close its -log sources and spin in an idle loop. Subsequent receipt of a -.B SIGCONT -signal will cause the daemon to go through its initialization sequence -and re-choose an input source. Using -.BR SIGSTOP " and " SIGCONT -in combination the kernel log input can be re-chosen without stopping and -restarting the daemon. For example if the \fI/proc\fR file system is to be -un-mounted the following command sequence should be used: -.PP -.PD 0 -.TP - # kill -TSTP pid -.TP - # umount /proc -.TP - # kill -CONT pid -.PD -.PP -Notations will be made in the system logs with -.B LOG_INFO -priority -documenting the start/stop of logging. - -The -.BR SIGUSR1 " and " SIGUSR2 -signals are used to initiate loading/reloading of kernel symbol information. -Receipt of the -.B SIGUSR1 -signal will cause the kernel module symbols to be reloaded. Signaling the -daemon with -.B SIGUSR2 -will cause both the static kernel symbols and the kernel module symbols to -be reloaded. - -Provided that the System.map file is placed in an appropriate location the -signal of generally greatest usefulness is the -.B SIGUSR1 -signal. This signal is designed to be used to signal the daemon when kernel -modules are loaded/unloaded. Sending this signal to the daemon after a -kernel module state change will insure that proper resolution of symbols will -occur if a protection fault occurs in the address space occupied by a kernel -module. -.LP -.SH FILES -.PD 0 -.TP -.I /proc/kmsg -One Source for kernel messages -.B rklogd -.TP -.I /var/run/rklogd.pid -The file containing the process id of -.B rklogd -.TP -.I /boot/System.map, /System.map, /usr/src/linux/System.map -Default locations for kernel system maps. -.PD -.SH BUGS -Probably numerous. Well formed context diffs appreciated. -.LP -.SH AUTHOR -The -.B rklogd -was originally written by Steve Lord (lord@cray.com), Greg Wettstein -made major improvements. - -.PD 0 -.TP -Dr. Greg Wettstein (greg@wind.enjellic.com) -.TP -Enjellic Systems Development -.PD -.PP -.PD 0 -.TP -Oncology Research Divsion Computing Facility -.TP -Roger Maris Cancer Center -.TP -Fargo, ND 58122 -.PD -- cgit v1.2.3 From 5cae1fdfc5ae6ac2aa0fbf2a6fcc9f38eaa389ec Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 1 Apr 2008 07:13:42 +0000 Subject: - bugfix: rsyslogd was no longer build by default; man pages are only installed if corresponding option is selected. Thanks to Michael Biebl for pointing these problems out. --- ChangeLog | 5 + Makefile.am | 7 +- configure.ac | 41 +++++- rklogd.8 | 440 ----------------------------------------------------------- 4 files changed, 49 insertions(+), 444 deletions(-) delete mode 100644 rklogd.8 diff --git a/ChangeLog b/ChangeLog index 8f3499c9..01da05e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ --------------------------------------------------------------------------- +Version 3.14.0 (rgerhards), 2008-04-02 +- bugfix: rsyslogd was no longer build by default; man pages are + only installed if corresponding option is selected. Thanks to + Michael Biebl for pointing these problems out. +--------------------------------------------------------------------------- Version 3.13.0-dev0 (rgerhards), 2008-03-31 - bugfix: accidently set debug option in 3.12.5 reset to production This option prevented dlclose() to be called. It had no real bad effects, diff --git a/Makefile.am b/Makefile.am index 99f542fb..eb0497a6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,6 @@ #sbin_PROGRAMS = rfc3195d rsyslogd sbin_PROGRAMS = +man_MANS = if ENABLE_RSYSLOGD sbin_PROGRAMS += rsyslogd @@ -94,6 +95,9 @@ rsyslogd_SOURCES = \ rsyslogd_CPPFLAGS = -D_PATH_MODDIR=\"$(pkglibdir)/\" $(pthreads_cflags) rsyslogd_LDADD = $(zlib_libs) $(pthreads_libs) $(dl_libs) $(rt_libs) rsyslogd_LDFLAGS = -export-dynamic + +man_MANS += rsyslogd.8 rsyslog.conf.5 + endif # if ENABLE_RSYSLOGD # now come the library plugins @@ -103,6 +107,7 @@ if ENABLE_RFC3195 # this does so far not work - a manual build is needed sbin_PROGRAMS += rfc3195d rfc3195d_SOURCES = rfc3195d.c rsyslog.h +man_MANS += rfc3195d.8 endif @@ -173,8 +178,6 @@ lmrelputil_la_LDFLAGS = -module -avoid-version lmrelputil_la_LIBADD = $(relp_libs) endif -man_MANS = rfc3195d.8 rsyslogd.8 rsyslog.conf.5 - EXTRA_DIST = \ redhat/rsyslog.conf \ redhat/rsyslog.init \ diff --git a/configure.ac b/configure.ac index 04ec3db5..a6a90fbe 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([rsyslog],[3.13.0-dev0],[rsyslog@lists.adiscon.com]) +AC_INIT([rsyslog],[3.14.0],[rsyslog@lists.adiscon.com]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([syslogd.c]) AC_CONFIG_HEADERS([config.h]) @@ -413,6 +413,42 @@ AC_SUBST(libdbi_cflags) AC_SUBST(libdbi_libs) +# openssl support +AC_ARG_ENABLE(openssl, + [AS_HELP_STRING([--enable-openssl],[Enable openssl support @<:@default=yes@:>@])], + [case "${enableval}" in + yes) enable_openssl="yes" ;; + no) enable_openssl="no" ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-openssl) ;; + esac], + [enable_openssl=no] +) +if test "x$enable_openssl" = "xyes"; then + AC_CHECK_HEADERS( + [openssl/ssl.h],, + [AC_MSG_FAILURE([openssl is missing])] + ) + AC_CHECK_LIB( + [crypto], + [CRYPTO_new_ex_data], + [openssl_cflags="" + openssl_libs="-lcrypto" + ], + [AC_MSG_FAILURE([library 'crypto' is missing (needed for openssl)])] + ) + AC_CHECK_LIB( + [ssl], + [SSL_library_init], + [ openssl_libs+="-lssl" + ], + [AC_MSG_FAILURE([library 'ssl' is missing (needed for openssl)])] + ) +fi +AM_CONDITIONAL(ENABLE_OPENSSL, test x$enable_openssl = xyes) +AC_SUBST(openssl_cflags) +AC_SUBST(openssl_libs) + + # SNMP support AC_ARG_ENABLE(snmp, [AS_HELP_STRING([--enable-snmp],[Enable SNMP support @<:@default=no@:>@])], @@ -450,7 +486,7 @@ AC_ARG_ENABLE(rsyslogd, no) enable_rsyslogd="no" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-rsyslogd) ;; esac], - [enable_rsyslogd=no] + [enable_rsyslogd=yes] ) AM_CONDITIONAL(ENABLE_RSYSLOGD, test x$enable_rsyslogd = xyes) @@ -599,6 +635,7 @@ echo "Networking support enabled: $enable_inet" echo "Enable GSSAPI Kerberos 5 support: $want_gssapi_krb5" echo "Debug mode enabled: $enable_debug" echo "Runtime Instrumentation enabled: $enable_rtinst" +echo "openssl enabled: $enable_openssl" echo "valgrind support settings enabled: $enable_valgrind" echo "rsyslogd will be built: $enable_rsyslogd" diff --git a/rklogd.8 b/rklogd.8 deleted file mode 100644 index 39a0a1fa..00000000 --- a/rklogd.8 +++ /dev/null @@ -1,440 +0,0 @@ -.\" Copyright 1994 Dr. Greg Wettstein, Enjellic Systems Development. -.\" May be distributed under the GNU General Public License -.\" Sun Jul 30 01:35:55 MET: Martin Schulze: Updates -.\" Sun Nov 19 23:22:21 MET: Martin Schulze: Updates -.\" Mon Aug 19 09:42:08 CDT 1996: Dr. G.W. Wettstein: Updates -.\" -.TH RKLOGD 8 "03 JULY 2007" "Version 1.14.2 (devel)" "Linux System Administration" -.SH NAME -rklogd \- Kernel Log Daemon -.LP -.SH SYNOPSIS -.B rklogd -.RB [ " \-c " -.I n -] -.RB [ " \-d " ] -.RB [ " \-f " -.I fname -] -.RB [ " \-iI " ] -.RB [ " \-n " ] -.RB [ " \-o " ] -.RB [ " \-p " ] -.RB [ " \-s " ] -.RB [ " \-k " -.I fname -] -.RB [ " \-v " ] -.RB [ " \-x " ] -.RB [ " \-2 " ] -.LP -.SH DESCRIPTION -.B rklogd -is a system daemon which intercepts and logs Linux kernel -messages. -.LP -.SH OPTIONS -.TP -.BI "\-c " n -Sets the default log level of console messages to \fIn\fR. -.TP -.B "\-d" -Enable debugging mode. This will generate \fBLOTS\fR of output to -stderr. -.TP -.BI "\-f " file -Log messages to the specified filename rather than to the syslog facility. -.TP -.BI "\-i \-I" -Signal the currently executing rklogd daemon. Both of these switches control -the loading/reloading of symbol information. The \-i switch signals the -daemon to reload the kernel module symbols. The \-I switch signals for a -reload of both the static kernel symbols and the kernel module symbols. -.TP -.B "\-n" -Avoid auto-backgrounding. This is needed especially if the -.B rklogd -is started and controlled by -.BR init (8). -.TP -.B "-o" -Execute in 'one\-shot' mode. This causes \fBrklogd\fP to read and log -all the messages that are found in the kernel message buffers. After -a single read and log cycle the daemon exits. -.TP -.B "-p" -Enable paranoia. This option controls when rklogd loads kernel module symbol -information. Setting this switch causes rklogd to load the kernel module -symbol information whenever an Oops string is detected in the kernel message -stream. -.TP -.B "-s" -Force \fBrklogd\fP to use the system call interface to the kernel message -buffers. -.TP -.BI "\-k " file -Use the specified file as the source of kernel symbol information. -.TP -.B "\-v" -Print version and exit. -.TP -.B "\-x" -Omits EIP translation and therefore doesn't read the System.map file. -.TP -.B "\-2" -When symbols are expanded, print the line twice. Once with addresses -converted to symbols, once with the raw text. This allows external -programs such as ksymoops do their own processing on the original -data. -.LP -.SH OVERVIEW -The functionality of rklogd has been typically incorporated into other -versions of syslogd but this seems to be a poor place for it. In the -modern Linux kernel a number of kernel messaging issues such as -sourcing, prioritization and resolution of kernel addresses must be -addressed. Incorporating kernel logging into a separate process -offers a cleaner separation of services. - -In Linux there are two potential sources of kernel log information: the -.I /proc -file system and the syscall (sys_syslog) interface, although -ultimately they are one and the same. Klogd is designed to choose -whichever source of information is the most appropriate. It does this -by first checking for the presence of a mounted -.I /proc -file system. If this is found the -.I /proc/kmsg -file is used as the source of kernel log -information. If the proc file system is not mounted -.B rklogd -uses a -system call to obtain kernel messages. The command line switch -.RB ( "\-s" ) -can be used to force rklogd to use the system call interface as its -messaging source. - -If kernel messages are directed through the -.BR syslogd " daemon the " rklogd -daemon, as of version 1.1, has the ability to properly prioritize -kernel messages. Prioritization of the kernel messages was added to it -at approximately version 0.99pl13 of the kernel. The raw kernel messages -are of the form: -.IP -\<[0\-7]\>Something said by the kernel. -.PP -The priority of the kernel message is encoded as a single numeric -digit enclosed inside the <> pair. The definitions of these values is -given in the kernel include file kernel.h. When a message is received -from the kernel the rklogd daemon reads this priority level and assigns -the appropriate priority level to the syslog message. If file output -(\fB-f\fR) is used the prioritization sequence is left pre\-pended to the -kernel message. - -The -.B rklogd -daemon also allows the ability to alter the presentation of -kernel messages to the system console. Consequent with the -prioritization of kernel messages was the inclusion of default -messaging levels for the kernel. In a stock kernel the the default -console log level is set to 7. Any messages with a priority level -numerically lower than 7 (higher priority) appear on the console. - -Messages of priority level 7 are considered to be 'debug' messages and -will thus not appear on the console. Many administrators, -particularly in a multi\-user environment, prefer that all kernel -messages be handled by rklogd and either directed to a file or to -the syslogd daemon. This prevents 'nuisance' messages such as line -printer out of paper or disk change detected from cluttering the -console. - -When -.B \-c -is given on the commandline the -.B rklogd -daemon will execute a system call to inhibit all kernel messages from -being displayed on the console. Former versions always issued this -system call and defaulted to all kernel messages except for panics. -This is handled differently nowardays so -.B rklogd -doesn't need to set this value anymore. The -argument given to the \fB\-c\fR switch specifies the priority level of -messages which will be directed to the console. Note that messages of -a priority value LOWER than the indicated number will be directed to -the console. -.IP -For example, to have the kernel display all messages with a -priority level of 3 -.BR "" ( KERN_ERR ) -or more severe the following -command would be executed: -.IP -.nf - rklogd \-c 4 -.fi -.PP -The definitions of the numeric values for kernel messages are given in -the file -.IR kernel.h " which can be found in the " /usr/include/linux -directory if the kernel sources are installed. These values parallel -the syslog priority values which are defined in the file -.IR syslog.h " found in the " /usr/include/sys " sub\-directory." - -The rklogd daemon can also be used in a 'one\-shot' mode for reading the -kernel message buffers. One shot mode is selected by specifying the -\fB\-o\fR switch on the command line. Output will be directed to either the -syslogd daemon or to an alternate file specified by the \fB-f\fR switch. -.IP -For example, to read all the kernel messages after a system -boot and record them in a file called krnl.msg the following -command would be given. -.IP -.nf - rklogd -o -f ./krnl.msg -.fi -.PP -.SH KERNEL ADDRESS RESOLUTION -If the kernel detects an internal error condition a general protection -fault will be triggered. As part of the GPF handling procedure the -kernel prints out a status report indicating the state of the -processor at the time of the fault. Included in this display are the -contents of the microprocessor's registers, the contents of the kernel -stack and a tracing of what functions were being executed at the time -of the fault. - -This information is -.B EXTREMELY IMPORTANT -in determining what caused the internal error condition. The -difficulty comes when a kernel developer attempts to analyze this -information. The raw numeric information present in the protection -fault printout is of very little use to the developers. This is due -to the fact that kernels are not identical and the addresses of -variable locations or functions will not be the same in all kernels. -In order to correctly diagnose the cause of failure a kernel developer -needs to know what specific kernel functions or variable locations -were involved in the error. - -As part of the kernel compilation process a listing is created which -specified the address locations of important variables and function in -the kernel being compiled. This listing is saved in a file called -System.map in the top of the kernel directory source tree. Using this -listing a kernel developer can determine exactly what the kernel was -doing when the error condition occurred. - -The process of resolving the numeric addresses from the protection -fault printout can be done manually or by using the -.B ksymoops -program which is included in the kernel sources. - -As a convenience -.B rklogd -will attempt to resolve kernel numeric addresses to their symbolic -forms if a kernel symbol table is available at execution time. If you -require the original address of the symbol, use the -.B -2 -switch to preserve the numeric address. A -symbol table may be specified by using the \fB\-k\fR switch on the -command line. If a symbol file is not explicitly specified the -following filenames will be tried: - -.nf -.I /boot/System.map -.I /System.map -.I /usr/src/linux/System.map -.fi - -Version information is supplied in the system maps as of kernel -1.3.43. This version information is used to direct an intelligent -search of the list of symbol tables. This feature is useful since it -provides support for both production and experimental kernels. - -For example a production kernel may have its map file stored in -/boot/System.map. If an experimental or test kernel is compiled with -the sources in the 'standard' location of /usr/src/linux the system -map will be found in /usr/src/linux/System.map. When rklogd starts -under the experimental kernel the map in /boot/System.map will be -bypassed in favor of the map in /usr/src/linux/System.map. - -Modern kernels as of 1.3.43 properly format important kernel addresses -so that they will be recognized and translated by rklogd. Earlier -kernels require a source code patch be applied to the kernel sources. -This patch is supplied with the sysrklogd sources. - -The process of analyzing kernel protections faults works very well -with a static kernel. Additional difficulties are encountered when -attempting to diagnose errors which occur in loadable kernel modules. -Loadable kernel modules are used to implement kernel functionality in -a form which can be loaded or unloaded at will. The use of loadable -modules is useful from a debugging standpoint and can also be useful -in decreasing the amount of memory required by a kernel. - -The difficulty with diagnosing errors in loadable modules is due to -the dynamic nature of the kernel modules. When a module is loaded the -kernel will allocate memory to hold the module, when the module is -unloaded this memory will be returned back to the kernel. This -dynamic memory allocation makes it impossible to produce a map file -which details the addresses of the variable and functions in a kernel -loadable module. Without this location map it is not possible for a -kernel developer to determine what went wrong if a protection fault -involves a kernel module. - -.B rklogd -has support for dealing with the problem of diagnosing protection -faults in kernel loadable modules. At program start time or in -response to a signal the daemon will interrogate the kernel for a -listing of all modules loaded and the addresses in memory they are -loaded at. Individual modules can also register the locations of -important functions when the module is loaded. The addresses of these -exported symbols are also determined during this interrogation -process. - -When a protection fault occurs an attempt will be made to resolve -kernel addresses from the static symbol table. If this fails the -symbols from the currently loaded modules are examined in an attempt -to resolve the addresses. At the very minimum this allows rklogd to -indicate which loadable module was responsible for generating the -protection fault. Additional information may be available if the -module developer chose to export symbol information from the module. - -Proper and accurate resolution of addresses in kernel modules requires -that -.B rklogd -be informed whenever the kernel module status changes. The -.B \-i -and -.B \-I -switches can be used to signal the currently executing daemon that -symbol information be reloaded. Of most importance to proper -resolution of module symbols is the -.B \-i -switch. Each time a kernel module is loaded or removed from the -kernel the following command should be executed: - -.nf -.I rklogd \-i -.fi - -The -.B \-p -switch can also be used to insure that module symbol information is up -to date. This switch instructs -.B rklogd -to reload the module symbol information whenever a protection fault -is detected. Caution should be used before invoking the program in -\'paranoid\' mode. The stability of the kernel and the operating -environment is always under question when a protection fault occurs. -Since the rklogd daemon must execute system calls in order to read the -module symbol information there is the possibility that the system may -be too unstable to capture useful information. A much better policy -is to insure that rklogd is updated whenever a module is loaded or -unloaded. Having uptodate symbol information loaded increases the -probability of properly resolving a protection fault if it should occur. - -Included in the sysrklogd source distribution is a patch to the -modules-2.0.0 package which allows the -.B insmod, -.B rmmod -and -.B modprobe -utilities to automatically signal -.B rklogd -whenever a module is inserted or removed from the kernel. Using this -patch will insure that the symbol information maintained in rklogd is -always consistent with the current kernel state. -.PP -.SH SIGNAL HANDLING -The -.B rklogd -will respond to eight signals: -.BR SIGHUP ", " SIGINT ", " SIGKILL ", " SIGTERM ", " SIGTSTP ", " -.BR SIGUSR1 ", "SIGUSR2 " and " SIGCONT ". The" -.BR SIGINT ", " SIGKILL ", " SIGTERM " and " SIGHUP -signals will cause the daemon to close its kernel log sources and -terminate gracefully. - -The -.BR SIGTSTP " and " SIGCONT -signals are used to start and stop kernel logging. Upon receipt of a -.B SIGTSTP -signal the daemon will close its -log sources and spin in an idle loop. Subsequent receipt of a -.B SIGCONT -signal will cause the daemon to go through its initialization sequence -and re-choose an input source. Using -.BR SIGSTOP " and " SIGCONT -in combination the kernel log input can be re-chosen without stopping and -restarting the daemon. For example if the \fI/proc\fR file system is to be -un-mounted the following command sequence should be used: -.PP -.PD 0 -.TP - # kill -TSTP pid -.TP - # umount /proc -.TP - # kill -CONT pid -.PD -.PP -Notations will be made in the system logs with -.B LOG_INFO -priority -documenting the start/stop of logging. - -The -.BR SIGUSR1 " and " SIGUSR2 -signals are used to initiate loading/reloading of kernel symbol information. -Receipt of the -.B SIGUSR1 -signal will cause the kernel module symbols to be reloaded. Signaling the -daemon with -.B SIGUSR2 -will cause both the static kernel symbols and the kernel module symbols to -be reloaded. - -Provided that the System.map file is placed in an appropriate location the -signal of generally greatest usefulness is the -.B SIGUSR1 -signal. This signal is designed to be used to signal the daemon when kernel -modules are loaded/unloaded. Sending this signal to the daemon after a -kernel module state change will insure that proper resolution of symbols will -occur if a protection fault occurs in the address space occupied by a kernel -module. -.LP -.SH FILES -.PD 0 -.TP -.I /proc/kmsg -One Source for kernel messages -.B rklogd -.TP -.I /var/run/rklogd.pid -The file containing the process id of -.B rklogd -.TP -.I /boot/System.map, /System.map, /usr/src/linux/System.map -Default locations for kernel system maps. -.PD -.SH BUGS -Probably numerous. Well formed context diffs appreciated. -.LP -.SH AUTHOR -The -.B rklogd -was originally written by Steve Lord (lord@cray.com), Greg Wettstein -made major improvements. - -.PD 0 -.TP -Dr. Greg Wettstein (greg@wind.enjellic.com) -.TP -Enjellic Systems Development -.PD -.PP -.PD 0 -.TP -Oncology Research Divsion Computing Facility -.TP -Roger Maris Cancer Center -.TP -Fargo, ND 58122 -.PD -- cgit v1.2.3 From ba6a91bc105f7b2f55790ca705680d1311f1cc1d Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 1 Apr 2008 07:15:54 +0000 Subject: - bugfix: rsyslogd was no longer build by default; man pages are only installed if corresponding option is selected. Thanks to Michael Biebl for pointing these problems out. --- ChangeLog | 3 +++ Makefile.am | 7 +++++-- configure.ac | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index aa893f28..50744768 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ --------------------------------------------------------------------------- Version 3.15.0 (rgerhards), 2008-04-01 +- bugfix: rsyslogd was no longer build by default; man pages are + only installed if corresponding option is selected. Thanks to + Michael Biebl for pointing these problems out. --------------------------------------------------------------------------- Version 3.13.0-dev0 (rgerhards), 2008-03-31 - bugfix: accidently set debug option in 3.12.5 reset to production diff --git a/Makefile.am b/Makefile.am index 99f542fb..eb0497a6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,6 @@ #sbin_PROGRAMS = rfc3195d rsyslogd sbin_PROGRAMS = +man_MANS = if ENABLE_RSYSLOGD sbin_PROGRAMS += rsyslogd @@ -94,6 +95,9 @@ rsyslogd_SOURCES = \ rsyslogd_CPPFLAGS = -D_PATH_MODDIR=\"$(pkglibdir)/\" $(pthreads_cflags) rsyslogd_LDADD = $(zlib_libs) $(pthreads_libs) $(dl_libs) $(rt_libs) rsyslogd_LDFLAGS = -export-dynamic + +man_MANS += rsyslogd.8 rsyslog.conf.5 + endif # if ENABLE_RSYSLOGD # now come the library plugins @@ -103,6 +107,7 @@ if ENABLE_RFC3195 # this does so far not work - a manual build is needed sbin_PROGRAMS += rfc3195d rfc3195d_SOURCES = rfc3195d.c rsyslog.h +man_MANS += rfc3195d.8 endif @@ -173,8 +178,6 @@ lmrelputil_la_LDFLAGS = -module -avoid-version lmrelputil_la_LIBADD = $(relp_libs) endif -man_MANS = rfc3195d.8 rsyslogd.8 rsyslog.conf.5 - EXTRA_DIST = \ redhat/rsyslog.conf \ redhat/rsyslog.init \ diff --git a/configure.ac b/configure.ac index 81361ef0..ca2cf484 100644 --- a/configure.ac +++ b/configure.ac @@ -450,7 +450,7 @@ AC_ARG_ENABLE(rsyslogd, no) enable_rsyslogd="no" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-rsyslogd) ;; esac], - [enable_rsyslogd=no] + [enable_rsyslogd=yes] ) AM_CONDITIONAL(ENABLE_RSYSLOGD, test x$enable_rsyslogd = xyes) -- cgit v1.2.3 From f7de219916f9092ac4667820bd480dd1d8a0e4a0 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 1 Apr 2008 07:17:49 +0000 Subject: removed accidently added openssl check --- configure.ac | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/configure.ac b/configure.ac index a6a90fbe..7012018d 100644 --- a/configure.ac +++ b/configure.ac @@ -413,42 +413,6 @@ AC_SUBST(libdbi_cflags) AC_SUBST(libdbi_libs) -# openssl support -AC_ARG_ENABLE(openssl, - [AS_HELP_STRING([--enable-openssl],[Enable openssl support @<:@default=yes@:>@])], - [case "${enableval}" in - yes) enable_openssl="yes" ;; - no) enable_openssl="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-openssl) ;; - esac], - [enable_openssl=no] -) -if test "x$enable_openssl" = "xyes"; then - AC_CHECK_HEADERS( - [openssl/ssl.h],, - [AC_MSG_FAILURE([openssl is missing])] - ) - AC_CHECK_LIB( - [crypto], - [CRYPTO_new_ex_data], - [openssl_cflags="" - openssl_libs="-lcrypto" - ], - [AC_MSG_FAILURE([library 'crypto' is missing (needed for openssl)])] - ) - AC_CHECK_LIB( - [ssl], - [SSL_library_init], - [ openssl_libs+="-lssl" - ], - [AC_MSG_FAILURE([library 'ssl' is missing (needed for openssl)])] - ) -fi -AM_CONDITIONAL(ENABLE_OPENSSL, test x$enable_openssl = xyes) -AC_SUBST(openssl_cflags) -AC_SUBST(openssl_libs) - - # SNMP support AC_ARG_ENABLE(snmp, [AS_HELP_STRING([--enable-snmp],[Enable SNMP support @<:@default=no@:>@])], @@ -635,7 +599,6 @@ echo "Networking support enabled: $enable_inet" echo "Enable GSSAPI Kerberos 5 support: $want_gssapi_krb5" echo "Debug mode enabled: $enable_debug" echo "Runtime Instrumentation enabled: $enable_rtinst" -echo "openssl enabled: $enable_openssl" echo "valgrind support settings enabled: $enable_valgrind" echo "rsyslogd will be built: $enable_rsyslogd" -- cgit v1.2.3 From 9bed1de84aa17553af614e89327fd8b50ddb6466 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 1 Apr 2008 16:45:25 +0000 Subject: relputil is no longer needed --- Makefile.am | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index eb0497a6..75250925 100644 --- a/Makefile.am +++ b/Makefile.am @@ -171,11 +171,11 @@ endif # relp support # if ENABLE_RELP -pkglib_LTLIBRARIES += lmrelputil.la -lmrelputil_la_SOURCES = relputil.c relputil.h -lmrelputil_la_CPPFLAGS = $(pthreads_cflags) $(relp_cflags) -lmrelputil_la_LDFLAGS = -module -avoid-version -lmrelputil_la_LIBADD = $(relp_libs) +#pkglib_LTLIBRARIES += lmrelputil.la +#lmrelputil_la_SOURCES = relputil.c relputil.h +#lmrelputil_la_CPPFLAGS = $(pthreads_cflags) $(relp_cflags) +#lmrelputil_la_LDFLAGS = -module -avoid-version +#lmrelputil_la_LIBADD = $(relp_libs) endif EXTRA_DIST = \ -- cgit v1.2.3 From c5ae5472681c2fd594bb210c5794a83dbdc90eed Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 1 Apr 2008 16:46:04 +0000 Subject: preparing for 3.15.0 release --- ChangeLog | 5 +++++ doc/rsyslog_conf.html | 4 ++-- doc/status.html | 8 ++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 50744768..25cd1106 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ --------------------------------------------------------------------------- Version 3.15.0 (rgerhards), 2008-04-01 +- major new feature: imrelp/omrelp support reliable delivery of syslog + messages via the RELP protocol and librelp (http://www.librelp.com). + Plain tcp syslog, so far the best reliability solution, can lose + messages when something goes wrong or a peer goes down. With RELP, + this can no longer happen. See imrelp.html for more details. - bugfix: rsyslogd was no longer build by default; man pages are only installed if corresponding option is selected. Thanks to Michael Biebl for pointing these problems out. diff --git a/doc/rsyslog_conf.html b/doc/rsyslog_conf.html index 5931a241..2a0f0c60 100644 --- a/doc/rsyslog_conf.html +++ b/doc/rsyslog_conf.html @@ -26,7 +26,7 @@ number of modules. Here is the entry point to their documentation and what they do (list is currently not complete)

  • omsnmp - SNMP -trap output module
  • omrelp - RELP output module
  • +trap output module
  • omrelp - RELP output module
  • omgss - output module for GSS-enabled syslog
  • ommysql - output module for MySQL
  • ompgsql - output module for PostgreSQL
  • @@ -34,7 +34,7 @@ trap output module
  • omrelp - RELP output module
  • generic database output module (Firebird/Interbase, MS SQL, Sybase, SQLLite, Ingres, Oracle, mSQL)
  • imfile --  input module for text files
  • imrelp - RELP input module
  • +-  input module for text files
  • imrelp - RELP input module
  • imudp - udp syslog message input
  • imtcp - input plugin for plain tcp syslog
  • diff --git a/doc/status.html b/doc/status.html index c6901fb9..c76fe348 100644 --- a/doc/status.html +++ b/doc/status.html @@ -2,12 +2,12 @@ rsyslog status page

    rsyslog status page

    -

    This page reflects the status as of 2008-03-31.

    +

    This page reflects the status as of 2008-04-01.

    Current Releases

    -

    development: 3.13.0-dev0 - -change log - -download

    +

    development: 3.15.0 - +change log - +download

    If you updgrade from version 2, be sure to read the rsyslog v3 compatibility document.

    -- cgit v1.2.3 From b4dbe03cfa862543a78a7abe18524f6e0c94b364 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 1 Apr 2008 17:05:13 +0000 Subject: added forgotten files --- doc/imrelp.html | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ doc/omrelp.html | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 doc/imrelp.html create mode 100644 doc/omrelp.html diff --git a/doc/imrelp.html b/doc/imrelp.html new file mode 100644 index 00000000..b6f1f2bc --- /dev/null +++ b/doc/imrelp.html @@ -0,0 +1,52 @@ + + +RELP Input Module + + + +

    RELP Input Module

    +

    Module Name:    imrelp

    +

    Author: Rainer Gerhards

    +

    Description:

    +

    Provides the ability to receive syslog messages via the +reliable RELP protocol. This module requires librelp to be +present on the system. From the user's point of view, imrelp works much +like imtcp or imgssapi, except that no message loss can occur. Please +note that with the currently supported relp protocol version, a minor +message duplication may occur if a network connection between the relp +client and relp server breaks after the client could successfully send +some messages but the server could not acknowledge them. The window of +opportunity is very slim, but in theory this is possible. Future +versions of RELP will prevent this. Please also note that rsyslogd may +lose a few messages if rsyslog is shutdown while a network conneciton +to the server is broken and could not yet be recovered. Future version +of RELP support in rsyslog will prevent that. Please note that both +scenarios also exists with plain tcp syslog. RELP, even with the small +nits outlined above, is a much more reliable solution than plain tcp +syslog and so it is highly suggested to use RELP instead of plain tcp. +Clients send messages to the RELP server via omrelp.

    +

    Configuration Directives:

    +
      +
    • InputRELPServerRun <port>
      +Starts a RELP server on selected port
    • +
    +Caveats/Known Bugs: +
      +
    • see description
    • +
    +

    Sample:

    +

    This sets up a RELP server on port 2514.
    +

    + +

    [rsyslog.conf overview] +[manual index] [rsyslog site]

    +

    This documentation is part of the +rsyslog +project.
    +Copyright © 2008 by Rainer +Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

    + \ No newline at end of file diff --git a/doc/omrelp.html b/doc/omrelp.html new file mode 100644 index 00000000..0952cc71 --- /dev/null +++ b/doc/omrelp.html @@ -0,0 +1,54 @@ + + +RELP Output Module (omrelp) + + + +

    RELP Output Module (omlibdbi)

    +

    Module Name:    omrelp

    +

    Author: Rainer Gerhards +<rgerhards@adiscon.com>

    +

    Description:

    +

    This module supports sending syslog messages over the reliable +RELP protocol. For RELP's advantages over plain tcp syslog, please see +the documentation for imrelp +(the server counterpart). 

    +Setup +

    Please note the librelp +is required for imrelp (it provides the core relp protocol +implementation).

    +

    Configuration Directives:

    +

    This module uses old-style action configuration to keep +consistent with the forwarding rule. So far, no additional +configuration directives can be specified. To send a message via RELP, +use

    +

    *.* + :omrelp:<sever>:<port>;<template>

    +

    just as you use 

    +

    *.* + @@<sever>:<port>;<template>

    +

    to forward a message via plain tcp syslog.

    +Caveats/Known Bugs: +

    See imrelp, +which documents them. 

    +

    Sample:

    +

    The following sample sends all messages to the central server +"centralserv" at port 2514 (note that that server must run imrelp on +port 2514). Rsyslog's high-precision timestamp format is used, thus the +special "RSYSLOG_ForwardFormat" (case sensitive!) template is used.
    +

    + +

    [rsyslog.conf overview] +[manual index] [rsyslog site]

    +

    This documentation is part of the +rsyslog +project.
    +Copyright © 2008 by Rainer +Gerhards and +Adiscon. +Released under the GNU GPL version 3 or higher.

    + \ No newline at end of file -- cgit v1.2.3 From eaad044b56eebdffe57d46a7c233ed144b541f9f Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 2 Apr 2008 06:42:36 +0000 Subject: disabled atomic operations for the time being because they introduce some cross-platform trouble - need to see how to fix this in the best possible way --- ChangeLog | 2 ++ Makefile.am | 5 ----- atomic.h | 9 ++++++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 01da05e2..99fcc50f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ Version 3.14.0 (rgerhards), 2008-04-02 - bugfix: rsyslogd was no longer build by default; man pages are only installed if corresponding option is selected. Thanks to Michael Biebl for pointing these problems out. +- disabled atomic operations for this stable build as it caused + platform problems --------------------------------------------------------------------------- Version 3.13.0-dev0 (rgerhards), 2008-03-31 - bugfix: accidently set debug option in 3.12.5 reset to production diff --git a/Makefile.am b/Makefile.am index eb0497a6..4b6602b1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -171,11 +171,6 @@ endif # relp support # if ENABLE_RELP -pkglib_LTLIBRARIES += lmrelputil.la -lmrelputil_la_SOURCES = relputil.c relputil.h -lmrelputil_la_CPPFLAGS = $(pthreads_cflags) $(relp_cflags) -lmrelputil_la_LDFLAGS = -module -avoid-version -lmrelputil_la_LIBADD = $(relp_libs) endif EXTRA_DIST = \ diff --git a/atomic.h b/atomic.h index 1883e030..2421c826 100644 --- a/atomic.h +++ b/atomic.h @@ -36,8 +36,15 @@ #define INCLUDED_ATOMIC_H /* set the following to 1 if we have atomic operations (and #undef it otherwise) */ -#define DO_HAVE_ATOMICS 1 +/* #define DO_HAVE_ATOMICS 1 */ +/* for this release, we disable atomic calls because there seem to be some + * portability problems and we can not fix that without destabilizing the build. + * They simply came in too late. -- rgerhards, 2008-04-02 + */ +/* make sure they are not used! #define ATOMIC_INC(data) ((void) __sync_fetch_and_add(&data, 1)) #define ATOMIC_DEC_AND_FETCH(data) __sync_sub_and_fetch(&data, 1) +*/ +#define ATOMIC_INC(data) (++(data)) #endif /* #ifndef INCLUDED_ATOMIC_H */ -- cgit v1.2.3 From 565c2b5cd87cd31781abf2116edef48afecdf9d4 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 2 Apr 2008 07:08:19 +0000 Subject: disabled atomic operations for the time being because they introduce some cross-platform trouble - need to see how to fix this in the best possible way --- ChangeLog | 5 +++++ atomic.h | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 25cd1106..3a13cccf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ --------------------------------------------------------------------------- +Version 3.15.1 (rgerhards), 2008-04-?? +- disabled atomic operations for the time being because they introduce some + cross-platform trouble - need to see how to fix this in the best + possible way +--------------------------------------------------------------------------- Version 3.15.0 (rgerhards), 2008-04-01 - major new feature: imrelp/omrelp support reliable delivery of syslog messages via the RELP protocol and librelp (http://www.librelp.com). diff --git a/atomic.h b/atomic.h index 1883e030..2421c826 100644 --- a/atomic.h +++ b/atomic.h @@ -36,8 +36,15 @@ #define INCLUDED_ATOMIC_H /* set the following to 1 if we have atomic operations (and #undef it otherwise) */ -#define DO_HAVE_ATOMICS 1 +/* #define DO_HAVE_ATOMICS 1 */ +/* for this release, we disable atomic calls because there seem to be some + * portability problems and we can not fix that without destabilizing the build. + * They simply came in too late. -- rgerhards, 2008-04-02 + */ +/* make sure they are not used! #define ATOMIC_INC(data) ((void) __sync_fetch_and_add(&data, 1)) #define ATOMIC_DEC_AND_FETCH(data) __sync_sub_and_fetch(&data, 1) +*/ +#define ATOMIC_INC(data) (++(data)) #endif /* #ifndef INCLUDED_ATOMIC_H */ -- cgit v1.2.3 From 35dc817c008cd54175cd2d6c747119a7cf1922c1 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 2 Apr 2008 08:05:31 +0000 Subject: added librelp check via PKG_CHECK thanks to Michael Biebl's patch --- configure.ac | 21 +++------------------ plugins/imrelp/Makefile.am | 4 ++-- plugins/omrelp/Makefile.am | 4 ++-- 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/configure.ac b/configure.ac index ca2cf484..498957da 100644 --- a/configure.ac +++ b/configure.ac @@ -466,26 +466,11 @@ AC_ARG_ENABLE(relp, [enable_relp=no] ) if test "x$enable_relp" = "xyes"; then - AC_CHECK_HEADERS( - [librelp.h],, - [AC_MSG_FAILURE([RELP library is missing (no headers)])] - ) -# I don't know how to tell that librelp needs -lrt, so I disable -# this check for now - the header check should work well enough... -# rgerhards, 2008-03-25 -# AC_CHECK_LIB( -# [relp], -# [relpEngineGetVersion], -# [relp_cflags="" - relp_libs="-lrelp" -# ], -# [AC_MSG_FAILURE([RELP library is missing])] -# ) + PKG_CHECK_MODULES(RELP, relp) fi AM_CONDITIONAL(ENABLE_RELP, test x$enable_relp = xyes) -AC_SUBST(relp_cflags) -AC_SUBST(relp_libs) - +AC_SUBST(RELP_CFLAGS) +AC_SUBST(RELP_LIBS) # RFC 3195 support # WARNING: THIS IS NOT REALLY PRESENT YET - needs to be build manually! diff --git a/plugins/imrelp/Makefile.am b/plugins/imrelp/Makefile.am index 167065b0..53c9322c 100644 --- a/plugins/imrelp/Makefile.am +++ b/plugins/imrelp/Makefile.am @@ -1,6 +1,6 @@ pkglib_LTLIBRARIES = imrelp.la imrelp_la_SOURCES = imrelp.c -imrelp_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(relp_cflags) +imrelp_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(RELP_CFLAGS) imrelp_la_LDFLAGS = -module -avoid-version -imrelp_la_LIBADD = $(relp_libs) +imrelp_la_LIBADD = $(RELP_LIBS) diff --git a/plugins/omrelp/Makefile.am b/plugins/omrelp/Makefile.am index edec5de9..dfc2111f 100644 --- a/plugins/omrelp/Makefile.am +++ b/plugins/omrelp/Makefile.am @@ -1,6 +1,6 @@ pkglib_LTLIBRARIES = omrelp.la omrelp_la_SOURCES = omrelp.c -omrelp_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(relp_cflags) +omrelp_la_CPPFLAGS = -I$(top_srcdir) $(pthreads_cflags) $(RELP_CFLAGS) omrelp_la_LDFLAGS = -module -avoid-version -omrelp_la_LIBADD = $(relp_libs) +omrelp_la_LIBADD = $(RELP_LIBS) -- cgit v1.2.3 From fe5770aa13ba5a092f5ea8a9f13dbe6585ea6b28 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 2 Apr 2008 08:06:21 +0000 Subject: bumped version number --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 498957da..c58c2173 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([rsyslog],[3.15.0],[rsyslog@lists.adiscon.com]) +AC_INIT([rsyslog],[3.15.1],[rsyslog@lists.adiscon.com]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([syslogd.c]) AC_CONFIG_HEADERS([config.h]) -- cgit v1.2.3 From e0ca4d182eda0111553dbb9c5500bbcc0370ee07 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 2 Apr 2008 08:08:13 +0000 Subject: file relputil.c deleted, not actually neeeded --- ChangeLog | 2 ++ Makefile.am | 11 ------ relputil.c | 113 ------------------------------------------------------------ 3 files changed, 2 insertions(+), 124 deletions(-) delete mode 100644 relputil.c diff --git a/ChangeLog b/ChangeLog index 3a13cccf..4f259084 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ Version 3.15.1 (rgerhards), 2008-04-?? - disabled atomic operations for the time being because they introduce some cross-platform trouble - need to see how to fix this in the best possible way +- added librelp check via PKG_CHECK thanks to Michael Biebl's patch +- file relputil.c deleted, is not actually needed --------------------------------------------------------------------------- Version 3.15.0 (rgerhards), 2008-04-01 - major new feature: imrelp/omrelp support reliable delivery of syslog diff --git a/Makefile.am b/Makefile.am index 75250925..f97687c1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -167,17 +167,6 @@ lmgssutil_la_LDFLAGS = -module -avoid-version lmgssutil_la_LIBADD = $(gss_libs) endif -# -# relp support -# -if ENABLE_RELP -#pkglib_LTLIBRARIES += lmrelputil.la -#lmrelputil_la_SOURCES = relputil.c relputil.h -#lmrelputil_la_CPPFLAGS = $(pthreads_cflags) $(relp_cflags) -#lmrelputil_la_LDFLAGS = -module -avoid-version -#lmrelputil_la_LIBADD = $(relp_libs) -endif - EXTRA_DIST = \ redhat/rsyslog.conf \ redhat/rsyslog.init \ diff --git a/relputil.c b/relputil.c deleted file mode 100644 index e90cb5a3..00000000 --- a/relputil.c +++ /dev/null @@ -1,113 +0,0 @@ -/* relputil.c - * - * This is a miscellaneous helper class for RELP features. - * - * Copyright 2008 Rainer Gerhards and Adiscon GmbH. - * - * This file is part of rsyslog. - * - * Rsyslog is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Rsyslog is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Rsyslog. If not, see . - * - * A copy of the GPL can be found in the file "COPYING" in this distribution. - */ -#include "config.h" -#include "rsyslog.h" -#include -#include -#include -#include -#include -#include -#include -#include "syslogd.h" -#include "syslogd-types.h" -#include "srUtils.h" -#include "net.h" -#include "omfwd.h" -#include "template.h" -#include "msg.h" -#include "tcpsyslog.h" -#include "module-template.h" -#include "obj.h" -#include "errmsg.h" -#include "relputil.h" - -MODULE_TYPE_LIB - -/* static data */ -DEFobjStaticHelpers -DEFobjCurrIf(errmsg) - - -/* queryInterface function - * rgerhards, 2008-02-29 - */ -BEGINobjQueryInterface(relputil) -CODESTARTobjQueryInterface(relputil) - if(pIf->ifVersion != relputilCURR_IF_VERSION) { /* check for current version, increment on each change */ - ABORT_FINALIZE(RS_RET_INTERFACE_NOT_SUPPORTED); - } - - /* ok, we have the right interface, so let's fill it - * Please note that we may also do some backwards-compatibility - * work here (if we can support an older interface version - that, - * of course, also affects the "if" above). - */ - -finalize_it: -ENDobjQueryInterface(relputil) - - -/* exit our class - * rgerhards, 2008-03-10 - */ -BEGINObjClassExit(relputil, OBJ_IS_LOADABLE_MODULE) /* CHANGE class also in END MACRO! */ -CODESTARTObjClassExit(relputil) - /* release objects we no longer need */ - objRelease(errmsg, CORE_COMPONENT); -ENDObjClassExit(relputil) - - -/* Initialize our class. Must be called as the very first method - * before anything else is called inside this class. - * rgerhards, 2008-02-29 - */ -BEGINAbstractObjClassInit(relputil, 1, OBJ_IS_LOADABLE_MODULE) /* class, version - CHANGE class also in END MACRO! */ - /* request objects we use */ - CHKiRet(objUse(errmsg, CORE_COMPONENT)); -ENDObjClassInit(relputil) - - -/* --------------- here now comes the plumbing that makes as a library module --------------- */ - - -BEGINmodExit -CODESTARTmodExit - relputilClassExit(); -ENDmodExit - - -BEGINqueryEtryPt -CODESTARTqueryEtryPt -CODEqueryEtryPt_STD_LIB_QUERIES -ENDqueryEtryPt - - -BEGINmodInit() -CODESTARTmodInit - *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ - - /* Initialize all classes that are in our module - this includes ourselfs */ - CHKiRet(relputilClassInit(pModInfo)); /* must be done after tcps_sess, as we use it */ -ENDmodInit -- cgit v1.2.3 From 0434294dd0df17f45bfcbb5925ff6d6d623c684a Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 2 Apr 2008 12:26:03 +0000 Subject: added more meaningful error messages to rsyslogd (when some errors happens during startup) --- ChangeLog | 2 ++ conf.c | 2 +- modules.c | 10 +++++----- rsyslog.h | 5 +++++ syslogd.c | 42 ++++++++++++++++++++++++++++++++++++++++-- 5 files changed, 53 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4f259084..3c20f16b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ Version 3.15.1 (rgerhards), 2008-04-?? possible way - added librelp check via PKG_CHECK thanks to Michael Biebl's patch - file relputil.c deleted, is not actually needed +- added more meaningful error messages to rsyslogd (when some errors + happens during startup) --------------------------------------------------------------------------- Version 3.15.0 (rgerhards), 2008-04-01 - major new feature: imrelp/omrelp support reliable delivery of syslog diff --git a/conf.c b/conf.c index f3f10ba3..14e73f0e 100644 --- a/conf.c +++ b/conf.c @@ -1199,7 +1199,7 @@ BEGINAbstractObjClassInit(conf, 1, OBJ_IS_CORE_MODULE) /* class, version - CHANG CHKiRet(objUse(ctok, CORE_COMPONENT)); CHKiRet(objUse(module, CORE_COMPONENT)); CHKiRet(objUse(errmsg, CORE_COMPONENT)); - CHKiRet(objUse(net, LM_NET_FILENAME)); + CHKiRet(objUse(net, LM_NET_FILENAME)); /* TODO: make this dependcy go away! */ ENDObjClassInit(conf) /* vi:set ai: diff --git a/modules.c b/modules.c index b6164f91..86ee64a5 100644 --- a/modules.c +++ b/modules.c @@ -594,7 +594,7 @@ Load(uchar *pModName) } else { errmsg.LogError(NO_ERRCODE, "could not load module '%s', path too long\n", pModName); free(pModNameDup); - ABORT_FINALIZE(RS_RET_ERR); + ABORT_FINALIZE(RS_RET_MODULE_LOAD_ERR_PATHLEN); } } } @@ -619,24 +619,24 @@ Load(uchar *pModName) if(iPathLen + strlen((char*) pModName) >= sizeof(szPath)) { errmsg.LogError(NO_ERRCODE, "could not load module '%s', path too long\n", pModName); - ABORT_FINALIZE(RS_RET_ERR); + ABORT_FINALIZE(RS_RET_MODULE_LOAD_ERR_PATHLEN); } /* complete load path constructed, so ... GO! */ dbgprintf("loading module '%s'\n", szPath); if(!(pModHdlr = dlopen((char *) szPath, RTLD_NOW))) { errmsg.LogError(NO_ERRCODE, "could not load module '%s', dlopen: %s\n", szPath, dlerror()); - ABORT_FINALIZE(RS_RET_ERR); + ABORT_FINALIZE(RS_RET_MODULE_LOAD_ERR_DLOPEN); } if(!(pModInit = dlsym(pModHdlr, "modInit"))) { errmsg.LogError(NO_ERRCODE, "could not load module '%s', dlsym: %s\n", szPath, dlerror()); dlclose(pModHdlr); - ABORT_FINALIZE(RS_RET_ERR); + ABORT_FINALIZE(RS_RET_MODULE_LOAD_ERR_NO_INIT); } if((iRet = doModInit(pModInit, (uchar*) pModName, pModHdlr)) != RS_RET_OK) { errmsg.LogError(NO_ERRCODE, "could not load module '%s', rsyslog error %d\n", szPath, iRet); dlclose(pModHdlr); - ABORT_FINALIZE(RS_RET_ERR); + ABORT_FINALIZE(RS_RET_MODULE_LOAD_ERR_INIT_FAILED); } finalize_it: diff --git a/rsyslog.h b/rsyslog.h index 01329aaf..9fe162d5 100644 --- a/rsyslog.h +++ b/rsyslog.h @@ -162,6 +162,11 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth RS_RET_OBJ_ALREADY_REGISTERED = -2061, /**< object (name) is already registered */ RS_RET_OBJ_REGISTRY_OUT_OF_SPACE = -2062, /**< the object registry has run out of space */ RS_RET_HOST_NOT_PERMITTED = -2063, /**< a host is not permitted to perform an action it requested */ + RS_RET_MODULE_LOAD_ERR = -2064, /**< module could not be loaded */ + RS_RET_MODULE_LOAD_ERR_PATHLEN = -2065, /**< module could not be loaded - path to long */ + RS_RET_MODULE_LOAD_ERR_DLOPEN = -2066, /**< module could not be loaded - problem in dlopen() */ + RS_RET_MODULE_LOAD_ERR_NO_INIT = -2067, /**< module could not be loaded - init() missing */ + RS_RET_MODULE_LOAD_ERR_INIT_FAILED = -2068, /**< module could not be loaded - init() failed */ /* RainerScript error messages (range 1000.. 1999) */ RS_RET_SYSVAR_NOT_FOUND = 1001, /**< system variable could not be found (maybe misspelled) */ diff --git a/syslogd.c b/syslogd.c index 1c31fb61..8c71f57d 100644 --- a/syslogd.c +++ b/syslogd.c @@ -2828,11 +2828,15 @@ static rsRetVal InitGlobalClasses(void) { DEFiRet; + char *pErrObj; /* tells us which object failed if that happens (useful for troubleshooting!) */ + pErrObj = "obj"; CHKiRet(objClassInit(NULL)); /* *THIS* *MUST* always be the first class initilizer being called! */ CHKiRet(objGetObjInterface(&obj)); /* this provides the root pointer for all other queries */ /* the following classes were intialized by objClassInit() */ + pErrObj = "errmsg"; CHKiRet(objUse(errmsg, CORE_COMPONENT)); + pErrObj = "module"; CHKiRet(objUse(module, CORE_COMPONENT)); /* initialize and use classes. We must be very careful with the order of events. Some @@ -2843,35 +2847,61 @@ InitGlobalClasses(void) * class immediately after it is initialized. And, of course, we load those classes * first that we use ourselfs... -- rgerhards, 2008-03-07 */ + pErrObj = "datetime"; CHKiRet(datetimeClassInit(NULL)); CHKiRet(objUse(datetime, CORE_COMPONENT)); + pErrObj = "msg"; CHKiRet(msgClassInit(NULL)); + pErrObj = "str,"; CHKiRet(strmClassInit(NULL)); + pErrObj = "wti"; CHKiRet(wtiClassInit(NULL)); + pErrObj = "wtp"; CHKiRet(wtpClassInit(NULL)); + pErrObj = "queue"; CHKiRet(queueClassInit(NULL)); + pErrObj = "vmstk"; CHKiRet(vmstkClassInit(NULL)); + pErrObj = "sysvar"; CHKiRet(sysvarClassInit(NULL)); + pErrObj = "vm"; CHKiRet(vmClassInit(NULL)); CHKiRet(objUse(vm, CORE_COMPONENT)); + pErrObj = "vmop"; CHKiRet(vmopClassInit(NULL)); + pErrObj = "vmprg"; CHKiRet(vmprgClassInit(NULL)); + pErrObj = "ctok_token"; CHKiRet(ctok_tokenClassInit(NULL)); + pErrObj = "ctok"; CHKiRet(ctokClassInit(NULL)); + pErrObj = "expr"; CHKiRet(exprClassInit(NULL)); CHKiRet(objUse(expr, CORE_COMPONENT)); + pErrObj = "conf"; CHKiRet(confClassInit(NULL)); CHKiRet(objUse(conf, CORE_COMPONENT)); /* dummy "classes" */ + pErrObj = "action"; CHKiRet(actionClassInit()); + pErrObj = "template"; CHKiRet(templateInit()); + pErrObj = "str"; CHKiRet(strInit()); /* TODO: the dependency on net shall go away! -- rgerhards, 2008-03-07 */ + pErrObj = "net"; CHKiRet(objUse(net, LM_NET_FILENAME)); finalize_it: + if(iRet != RS_RET_OK) { + /* we know we are inside the init sequence, so we can safely emit + * messages to stderr. -- rgerhards, 2008-04-02 + */ + fprintf(stderr, "Error during class init for object '%s' - failing...\n", pErrObj); + } + RETiRet; } @@ -2957,7 +2987,14 @@ int realMain(int argc, char **argv) int bImUxSockLoaded = 0; /* already generated a $ModLoad imuxsock? */ uchar legacyConfLine[80]; - CHKiRet(InitGlobalClasses()); + + CHKiRet_Hdlr(InitGlobalClasses()) { + fprintf(stderr, "rsyslogd initializiation failed - global classes could not be initialized.\n" + "Did you do a \"make install\"?\n" + "Suggested action: run rsyslogd with -d -n options to see what exactly " + "fails.\n"); + FINALIZE; + } /* doing some core initializations */ if((iRet = modInitIminternal()) != RS_RET_OK) { @@ -3298,7 +3335,8 @@ int realMain(int argc, char **argv) finalize_it: if(iRet != RS_RET_OK) - fprintf(stderr, "rsyslogd run failed with error %d.\n", iRet); + fprintf(stderr, "rsyslogd run failed with error %d\n(see rsyslog.h " + "or http://www.rsyslog.com/errcode to learn what that number means)\n", iRet); ENDfunc return 0; -- cgit v1.2.3 From ec089fb6add3536fe7cf5b5d790f75ca8ebfc058 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 2 Apr 2008 12:45:44 +0000 Subject: preparing for 3.14.0 release --- doc/status.html | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/doc/status.html b/doc/status.html index c6901fb9..bfced290 100644 --- a/doc/status.html +++ b/doc/status.html @@ -2,18 +2,26 @@ rsyslog status page

    rsyslog status page

    -

    This page reflects the status as of 2008-03-31.

    +

    This page reflects the status as of 2008-04-02.

    Current Releases

    -

    development: 3.13.0-dev0 - -change log - -download

    +

    development: 3.15.0 - +change log - +download

    + +

    v3 stable: 3.14.0 - change log - +download + +
    v2 stable: 2.0.4 - change log - +download +
    v0 and v1 are depricated and no longer supported. If you absolutely do not like to +upgrade, you may consider purchasing a +commercial rsyslog support package. Just let us point +out that it is really not a good idea to still run a v0 version. +

    If you updgrade from version 2, be sure to read the rsyslog v3 compatibility document.

    - -

    stable: 2.0.4 - change log - -download

    -

     (How are versions named?)

    +

    (How are versions named?)

    Platforms

    Thankfully, a number of folks have begin to build packages and -- cgit v1.2.3 From 47bb1f0d1a0b99116f3864ac5e98e9ca8bb8e921 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 2 Apr 2008 13:13:12 +0000 Subject: updated status informatation and syslog-ng comparison --- doc/rsyslog_ng_comparison.html | 178 +++++++++++++++++++++++++---------------- doc/status.html | 16 +++- 2 files changed, 120 insertions(+), 74 deletions(-) diff --git a/doc/rsyslog_ng_comparison.html b/doc/rsyslog_ng_comparison.html index 547501af..2a1d15bd 100644 --- a/doc/rsyslog_ng_comparison.html +++ b/doc/rsyslog_ng_comparison.html @@ -1,6 +1,8 @@ -rsyslog vs. syslog-ng - a comparison +rsyslog vs. syslog-ng - a comparison + +

    rsyslog vs. syslog-ng

    Written by Rainer Gerhards @@ -25,56 +27,72 @@ comparison sheet, so please don't be shy ;)

    rsyslog syslog-ng - - -
    Input Sources
    +
    +Input Sources
    + -UNIX domain socket + +UNIX domain socket +yes yes -yes - + + UDP yes -yes - +yes + + TCP yes -yes - +yes + + + +RELP +yes +no + + RFC 3195/BEEP yes (needs separate build process) -no - +no + + kernel log yes -yes - +yes + + file yes -yes - +yes + + -mark message generator as an optional input +mark message generator as an +optional input yes -no (?) - +no (?) + + Windows Event Log via EventReporter or MonitorWare Agent (both commercial software) -via separate Windows agent, paid edition only +via separate Windows agent, paid +edition only - - -
    Network (Protocol) Support

    +
    +Network (Protocol) Support

    + support for (plain) tcp based syslog @@ -104,6 +122,11 @@ based framing on syslog/tcp connections yes +syslog over RELP
    this is a truely reliable solution (plain tcp syslog can lose messages!) +yes +no + + on the wire (zlib) message compression yes @@ -146,38 +169,46 @@ hostname in NAT environments and relay chains yes yes - - -
    Message Filtering
    +
    +Message Filtering
    + -Filtering for syslog facility and priority + +Filtering for syslog facility and +priority yes -yes - +yes + + Filtering for hostname yes -yes - +yes + + Filtering for application yes -yes - +yes + + Filtering for message contents yes -yes - +yes + + Filtering for sending IP address yes -yes - +yes + + -ability to filter on any other message -field not mentioned above +ability to filter on any other +message +field not mentioned above (including substrings and the like) yes no @@ -210,8 +241,9 @@ in filters support for discarding messages based on filters yes -yes - +yes + + powerful BSD-style hostname and program name blocks for easy multi-host support @@ -223,10 +255,10 @@ program name blocks for easy multi-host support - - -
    Supported Database Outputs
    +
    +Supported Database Outputs
    + MySQL @@ -274,10 +306,10 @@ program name blocks for easy multi-host support yes (omlibdbi) no (?) - - -
    Enterprise Features
    +
    +Enterprise Features
    + support for on-demand on-disk @@ -292,7 +324,8 @@ by spool files yes -each action can use its own, independant +each action can use its own, +independant set of spool files yes no @@ -314,10 +347,10 @@ syslog/database servers yes yes - - -
    Config File
    +
    +Config File
    + config file format @@ -338,37 +371,40 @@ existing in a specific directory yes no - - - -
    Extensibility
    +
    +Extensibility
    + -Functionality split in separately loadable +Functionality split in separately +loadable modules yes no -Support for third-party input plugins +Support for third-party input +plugins yes no -Support for third-party output plugins + +Support for third-party output +plugins yes no - - - -
    Other Features
    +
    +Other Features
    + + + - ability to generate file names and directories (log targets) dynamically yes @@ -440,8 +476,9 @@ reduction ("last message repeated n times") on a per selector-line basis supports multiple actions per selector/filter condition yes -yes - +yes + + web interface phpLogCon
    @@ -469,8 +506,11 @@ system stress flow control (slow down message reception when system is busy) -yes (advanced, with multiple ways to slow down inputs depending on individual input capabilities, based on watermarks) -yes (limited? "stops accepting messages") +yes (advanced, +with multiple ways to slow down inputs depending on individual input +capabilities, based on watermarks) +yes (limited? +"stops accepting messages") rewriting messages @@ -504,8 +544,6 @@ Solaris; compilation and basic testing done on HP UX no yes - -

    While the rsyslog diff --git a/doc/status.html b/doc/status.html index c76fe348..b9bfd5c6 100644 --- a/doc/status.html +++ b/doc/status.html @@ -8,12 +8,20 @@

    development: 3.15.0 - change log - download

    + +

    v3 stable: 3.14.0 - change log - +download + +
    v2 stable: 2.0.4 - change log - +download +
    v0 and v1 are depricated and no longer supported. If you absolutely do not like to +upgrade, you may consider purchasing a +commercial rsyslog support package. Just let us point +out that it is really not a good idea to still run a v0 version. +

    If you updgrade from version 2, be sure to read the rsyslog v3 compatibility document.

    - -

    stable: 2.0.4 - change log - -download

    -

     (How are versions named?)

    +

    (How are versions named?)

    Platforms

    Thankfully, a number of folks have begin to build packages and -- cgit v1.2.3 From baf9a567599ada3da4b14f913fa4b10d0aabf03c Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 2 Apr 2008 14:42:49 +0000 Subject: updated version information in man pages --- rfc3195d.8 | 2 +- rsyslog.conf.5 | 2 +- rsyslogd.8 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rfc3195d.8 b/rfc3195d.8 index e585bc2c..ae191df6 100644 --- a/rfc3195d.8 +++ b/rfc3195d.8 @@ -1,7 +1,7 @@ .\" Copyright 2005 Rainer Gerhards and Adiscon for the rsyslog modifications .\" Distributed under the GNU General Public License. .\" -.TH RSYSLOGD 8 "03 July 2007" "Version 1.14.2 (devel)" "Linux System Administration" +.TH RFC3195D 8 "02 April 2008" "Version 3.14.0" "Linux System Administration" .SH NAME rfc3195d \- RFC 3195 listener .SH SYNOPSIS diff --git a/rsyslog.conf.5 b/rsyslog.conf.5 index e673e490..d7116678 100644 --- a/rsyslog.conf.5 +++ b/rsyslog.conf.5 @@ -17,7 +17,7 @@ .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. .\" -.TH RSYSLOG.CONF 5 "28 March 2008" "Version 3.12.5" "Linux System Administration" +.TH RSYSLOG.CONF 5 "02 April 2008" "Version 3.14.0" "Linux System Administration" .SH NAME rsyslog.conf \- rsyslogd(8) configuration file .SH DESCRIPTION diff --git a/rsyslogd.8 b/rsyslogd.8 index 353fb4c0..28fa6bb1 100644 --- a/rsyslogd.8 +++ b/rsyslogd.8 @@ -1,7 +1,7 @@ .\" Copyright 2004-2008 Rainer Gerhards and Adiscon for the rsyslog modifications .\" May be distributed under the GNU General Public License .\" -.TH RSYSLOGD 8 "28 March 2008" "Version 3.12.5 (devel)" "Linux System Administration" +.TH RSYSLOGD 8 "02 April 2008" "Version 3.14.0" "Linux System Administration" .SH NAME rsyslogd \- reliable and extended syslogd .SH SYNOPSIS -- cgit v1.2.3 From f1c9f5da133f4c6c8b52c5948cc0f61e32c210f1 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 3 Apr 2008 08:48:25 +0000 Subject: bugfix: memory leaks in script engine --- ChangeLog | 1 + conf.c | 6 ++++++ obj.h | 1 - queue.c | 2 ++ syslogd.c | 15 ++++++++++++--- var.c | 28 +++++++++++++++++++++------- vm.c | 5 ++--- vmop.c | 6 ++++++ vmstk.c | 2 -- 9 files changed, 50 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 99fcc50f..aef28847 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ Version 3.14.0 (rgerhards), 2008-04-02 Michael Biebl for pointing these problems out. - disabled atomic operations for this stable build as it caused platform problems +- bugfix: memory leaks in script engine --------------------------------------------------------------------------- Version 3.13.0-dev0 (rgerhards), 2008-03-31 - bugfix: accidently set debug option in 3.12.5 reset to production diff --git a/conf.c b/conf.c index f3f10ba3..65d76d63 100644 --- a/conf.c +++ b/conf.c @@ -68,6 +68,7 @@ static rsRetVal processConfFile(uchar *pConfFile); DEFobjStaticHelpers DEFobjCurrIf(expr) DEFobjCurrIf(ctok) +DEFobjCurrIf(ctok_token) DEFobjCurrIf(module) DEFobjCurrIf(errmsg) DEFobjCurrIf(net) @@ -762,9 +763,12 @@ dbgprintf("calling expression parser, pp %p ('%s')\n", *pline, *pline); */ CHKiRet(ctok.GetToken(tok, &pToken)); if(pToken->tok != ctok_THEN) { + ctok_token.Destruct(&pToken); ABORT_FINALIZE(RS_RET_SYNTAX_ERROR); } + ctok_token.Destruct(&pToken); /* no longer needed */ + /* we are done, so we now need to restore things */ CHKiRet(ctok.Getpp(tok, pline)); CHKiRet(ctok.Destruct(&tok)); @@ -1183,6 +1187,7 @@ CODESTARTObjClassExit(conf) /* release objects we no longer need */ objRelease(expr, CORE_COMPONENT); objRelease(ctok, CORE_COMPONENT); + objRelease(ctok_token, CORE_COMPONENT); objRelease(module, CORE_COMPONENT); objRelease(errmsg, CORE_COMPONENT); objRelease(net, LM_NET_FILENAME); @@ -1197,6 +1202,7 @@ BEGINAbstractObjClassInit(conf, 1, OBJ_IS_CORE_MODULE) /* class, version - CHANG /* request objects we use */ CHKiRet(objUse(expr, CORE_COMPONENT)); CHKiRet(objUse(ctok, CORE_COMPONENT)); + CHKiRet(objUse(ctok_token, CORE_COMPONENT)); CHKiRet(objUse(module, CORE_COMPONENT)); CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(net, LM_NET_FILENAME)); diff --git a/obj.h b/obj.h index a9d676d5..87c6c91d 100644 --- a/obj.h +++ b/obj.h @@ -92,7 +92,6 @@ /* interfaces */ BEGINinterface(obj) /* name must also be changed in ENDinterface macro! */ - //rsRetVal (*UseObj)(char *srcFile, uchar *pObjName, uchar *pMyLib, uchar *pObjFile, interface_t *pIf); rsRetVal (*UseObj)(char *srcFile, uchar *pObjName, uchar *pObjFile, interface_t *pIf); rsRetVal (*ReleaseObj)(char *srcFile, uchar *pObjName, uchar *pObjFile, interface_t *pIf); rsRetVal (*InfoConstruct)(objInfo_t **ppThis, uchar *pszID, int iObjVers, diff --git a/queue.c b/queue.c index ed720c55..7ae5815d 100644 --- a/queue.c +++ b/queue.c @@ -2208,6 +2208,8 @@ rsRetVal queueQueryInterface(void) { return RS_RET_NOT_IMPLEMENTED; } */ BEGINObjClassInit(queue, 1, OBJ_IS_CORE_MODULE) /* request objects we use */ +DEFpropSetMeth(queue, iDeqtWinFromHr, int); +DEFpropSetMeth(queue, iDeqtWinToHr, int); /* now set our own handlers */ OBJSetMethodHandler(objMethod_SETPROPERTY, queueSetProperty); diff --git a/syslogd.c b/syslogd.c index 1c31fb61..4bed94c8 100644 --- a/syslogd.c +++ b/syslogd.c @@ -170,6 +170,7 @@ DEFobjCurrIf(datetime) DEFobjCurrIf(conf) DEFobjCurrIf(expr) DEFobjCurrIf(vm) +DEFobjCurrIf(var) DEFobjCurrIf(module) DEFobjCurrIf(errmsg) DEFobjCurrIf(net) /* TODO: make go away! */ @@ -928,8 +929,8 @@ static rsRetVal shouldProcessThisMessage(selector_t *f, msg_t *pMsg, int *bProce unsigned short pbMustBeFreed; char *pszPropVal; int bRet = 0; - vm_t *pVM; - var_t *pResult; + vm_t *pVM = NULL; + var_t *pResult = NULL; assert(f != NULL); assert(pMsg != NULL); @@ -995,7 +996,7 @@ static rsRetVal shouldProcessThisMessage(selector_t *f, msg_t *pMsg, int *bProce CHKiRet(vm.ExecProg(pVM, f->f_filterData.f_expr->pVmprg)); CHKiRet(vm.PopBoolFromStack(pVM, &pResult)); dbgprintf("result of expression evaluation: %lld\n", pResult->val.num); - CHKiRet(vm.Destruct(&pVM)); + /* VM is destructed on function exit */ bRet = (pResult->val.num) ? 1 : 0; } else { assert(f->f_filter_type == FILTER_PROP); /* assert() just in case... */ @@ -1051,6 +1052,12 @@ static rsRetVal shouldProcessThisMessage(selector_t *f, msg_t *pMsg, int *bProce } finalize_it: + /* destruct in any case, not just on error, but it makes error handling much easier */ + if(pVM != NULL) { + var.Destruct(&pResult); + vm.Destruct(&pVM); + } + *bProcessMsg = bRet; RETiRet; } @@ -2838,6 +2845,8 @@ InitGlobalClasses(void) /* initialize and use classes. We must be very careful with the order of events. Some * classes use others and if we do not initialize them in the right order, we may end * up with an invalid call. The most important thing that can happen is that an error + pErrObj = "var"; + CHKiRet(objUse(var, CORE_COMPONENT)); * is detected and needs to be logged, wich in turn requires a broader number of classes * to be available. The solution is that we take care in the order of calls AND use a * class immediately after it is initialized. And, of course, we load those classes diff --git a/var.c b/var.c index c1d66643..7de00d88 100644 --- a/var.c +++ b/var.c @@ -63,12 +63,11 @@ rsRetVal varConstructFinalize(var_t __attribute__((unused)) *pThis) BEGINobjDestruct(var) /* be sure to specify the object type also in END and CODESTART macros! */ CODESTARTobjDestruct(var) if(pThis->pcsName != NULL) - d_free(pThis->pcsName); + rsCStrDestruct(&pThis->pcsName); if(pThis->varType == VARTYPE_STR) { if(pThis->val.pStr != NULL) - d_free(pThis->val.pStr); + rsCStrDestruct(&pThis->val.pStr); } - ENDobjDestruct(var) @@ -192,10 +191,16 @@ ConvToNumber(var_t *pThis) } else if(pThis->varType == VARTYPE_STR) { iRet = rsCStrConvertToNumber(pThis->val.pStr, &n); if(iRet == RS_RET_NOT_A_NUMBER) { - n = 0; /* TODO: isn't it better to pass the error? */ + n = 0; + iRet = RS_RET_OK; /* we accept this as part of the language definition */ } else if (iRet != RS_RET_OK) { FINALIZE; } + + /* we need to destruct the string first, because string and number are + * inside a union and share the memory area! -- rgerhards, 2008-04-03 + */ + rsCStrDestruct(&pThis->val.pStr); pThis->val.num = n; pThis->varType = VARTYPE_NUMBER; @@ -244,7 +249,18 @@ ConvToBool(var_t *pThis) if(pThis->varType == VARTYPE_NUMBER) { FINALIZE; } else if(pThis->varType == VARTYPE_STR) { - CHKiRet(rsCStrConvertToBool(pThis->val.pStr, &n)); + iRet = rsCStrConvertToBool(pThis->val.pStr, &n); + if(iRet == RS_RET_NOT_A_NUMBER) { + n = 0; + iRet = RS_RET_OK; /* we accept this as part of the language definition */ + } else if (iRet != RS_RET_OK) { + FINALIZE; + } + + /* we need to destruct the string first, because string and number are + * inside a union and share the memory area! -- rgerhards, 2008-04-03 + */ + rsCStrDestruct(&pThis->val.pStr); pThis->val.num = n; pThis->varType = VARTYPE_NUMBER; } @@ -366,8 +382,6 @@ CODESTARTobjQueryInterface(var) * work here (if we can support an older interface version - that, * of course, also affects the "if" above). */ - //xxxpIf->oID = OBJvar; - pIf->Construct = varConstruct; pIf->ConstructFinalize = varConstructFinalize; pIf->Destruct = varDestruct; diff --git a/vm.c b/vm.c index 3cd05622..a26e4331 100644 --- a/vm.c +++ b/vm.c @@ -109,8 +109,6 @@ BEGINop(name) \ number_t bRes; \ CODESTARTop(name) \ CHKiRet(vmstk.Pop2CommOp(pThis->pStk, &operand1, &operand2)); \ -var.DebugPrint(operand1); \ -var.DebugPrint(operand2); \ /* data types are equal (so we look only at operand1), but we must \ * check which type we have to deal with... \ */ \ @@ -122,7 +120,6 @@ var.DebugPrint(operand2); \ } \ \ /* we have a result, so let's push it */ \ -RUNLOG_VAR("%lld", bRes); \ var.SetNumber(operand1, bRes); \ vmstk.Push(pThis->pStk, operand1); /* result */ \ var.Destruct(&operand2); /* no longer needed */ \ @@ -374,6 +371,8 @@ BEGINobjDestruct(vm) /* be sure to specify the object type also in END and CODES CODESTARTobjDestruct(vm) if(pThis->pStk != NULL) vmstk.Destruct(&pThis->pStk); + if(pThis->pMsg != NULL) + msgDestruct(&pThis->pMsg); ENDobjDestruct(vm) diff --git a/vmop.c b/vmop.c index affa83e7..91f84b91 100644 --- a/vmop.c +++ b/vmop.c @@ -59,6 +59,12 @@ rsRetVal vmopConstructFinalize(vmop_t __attribute__((unused)) *pThis) /* destructor for the vmop object */ BEGINobjDestruct(vmop) /* be sure to specify the object type also in END and CODESTART macros! */ CODESTARTobjDestruct(vmop) + if( pThis->opcode == opcode_PUSHSYSVAR + || pThis->opcode == opcode_PUSHMSGVAR + || pThis->opcode == opcode_PUSHCONSTANT) { + if(pThis->operand.pVar != NULL) + var.Destruct(&pThis->operand.pVar); + } ENDobjDestruct(vmop) diff --git a/vmstk.c b/vmstk.c index 9ca815ff..f6614f71 100644 --- a/vmstk.c +++ b/vmstk.c @@ -201,8 +201,6 @@ CODESTARTobjQueryInterface(vmstk) * work here (if we can support an older interface version - that, * of course, also affects the "if" above). */ - //xxxpIf->oID = OBJvmstk; - pIf->Construct = vmstkConstruct; pIf->ConstructFinalize = vmstkConstructFinalize; pIf->Destruct = vmstkDestruct; -- cgit v1.2.3 From d0ca3acbf971141b8826d0bb3a184eaadb2804c1 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 3 Apr 2008 08:49:09 +0000 Subject: bugfix: memory leaks in script engine --- ChangeLog | 1 + conf.c | 6 ++++++ obj.h | 1 - queue.c | 2 ++ syslogd.c | 15 ++++++++++++--- var.c | 28 +++++++++++++++++++++------- vm.c | 5 ++--- vmop.c | 6 ++++++ vmstk.c | 2 -- 9 files changed, 50 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3c20f16b..66994c28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ Version 3.15.1 (rgerhards), 2008-04-?? - file relputil.c deleted, is not actually needed - added more meaningful error messages to rsyslogd (when some errors happens during startup) +- bugfix: memory leaks in script engine --------------------------------------------------------------------------- Version 3.15.0 (rgerhards), 2008-04-01 - major new feature: imrelp/omrelp support reliable delivery of syslog diff --git a/conf.c b/conf.c index 14e73f0e..f87ab992 100644 --- a/conf.c +++ b/conf.c @@ -68,6 +68,7 @@ static rsRetVal processConfFile(uchar *pConfFile); DEFobjStaticHelpers DEFobjCurrIf(expr) DEFobjCurrIf(ctok) +DEFobjCurrIf(ctok_token) DEFobjCurrIf(module) DEFobjCurrIf(errmsg) DEFobjCurrIf(net) @@ -762,9 +763,12 @@ dbgprintf("calling expression parser, pp %p ('%s')\n", *pline, *pline); */ CHKiRet(ctok.GetToken(tok, &pToken)); if(pToken->tok != ctok_THEN) { + ctok_token.Destruct(&pToken); ABORT_FINALIZE(RS_RET_SYNTAX_ERROR); } + ctok_token.Destruct(&pToken); /* no longer needed */ + /* we are done, so we now need to restore things */ CHKiRet(ctok.Getpp(tok, pline)); CHKiRet(ctok.Destruct(&tok)); @@ -1183,6 +1187,7 @@ CODESTARTObjClassExit(conf) /* release objects we no longer need */ objRelease(expr, CORE_COMPONENT); objRelease(ctok, CORE_COMPONENT); + objRelease(ctok_token, CORE_COMPONENT); objRelease(module, CORE_COMPONENT); objRelease(errmsg, CORE_COMPONENT); objRelease(net, LM_NET_FILENAME); @@ -1197,6 +1202,7 @@ BEGINAbstractObjClassInit(conf, 1, OBJ_IS_CORE_MODULE) /* class, version - CHANG /* request objects we use */ CHKiRet(objUse(expr, CORE_COMPONENT)); CHKiRet(objUse(ctok, CORE_COMPONENT)); + CHKiRet(objUse(ctok_token, CORE_COMPONENT)); CHKiRet(objUse(module, CORE_COMPONENT)); CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(net, LM_NET_FILENAME)); /* TODO: make this dependcy go away! */ diff --git a/obj.h b/obj.h index a9d676d5..87c6c91d 100644 --- a/obj.h +++ b/obj.h @@ -92,7 +92,6 @@ /* interfaces */ BEGINinterface(obj) /* name must also be changed in ENDinterface macro! */ - //rsRetVal (*UseObj)(char *srcFile, uchar *pObjName, uchar *pMyLib, uchar *pObjFile, interface_t *pIf); rsRetVal (*UseObj)(char *srcFile, uchar *pObjName, uchar *pObjFile, interface_t *pIf); rsRetVal (*ReleaseObj)(char *srcFile, uchar *pObjName, uchar *pObjFile, interface_t *pIf); rsRetVal (*InfoConstruct)(objInfo_t **ppThis, uchar *pszID, int iObjVers, diff --git a/queue.c b/queue.c index ed720c55..7ae5815d 100644 --- a/queue.c +++ b/queue.c @@ -2208,6 +2208,8 @@ rsRetVal queueQueryInterface(void) { return RS_RET_NOT_IMPLEMENTED; } */ BEGINObjClassInit(queue, 1, OBJ_IS_CORE_MODULE) /* request objects we use */ +DEFpropSetMeth(queue, iDeqtWinFromHr, int); +DEFpropSetMeth(queue, iDeqtWinToHr, int); /* now set our own handlers */ OBJSetMethodHandler(objMethod_SETPROPERTY, queueSetProperty); diff --git a/syslogd.c b/syslogd.c index 8c71f57d..b5554e5f 100644 --- a/syslogd.c +++ b/syslogd.c @@ -170,6 +170,7 @@ DEFobjCurrIf(datetime) DEFobjCurrIf(conf) DEFobjCurrIf(expr) DEFobjCurrIf(vm) +DEFobjCurrIf(var) DEFobjCurrIf(module) DEFobjCurrIf(errmsg) DEFobjCurrIf(net) /* TODO: make go away! */ @@ -928,8 +929,8 @@ static rsRetVal shouldProcessThisMessage(selector_t *f, msg_t *pMsg, int *bProce unsigned short pbMustBeFreed; char *pszPropVal; int bRet = 0; - vm_t *pVM; - var_t *pResult; + vm_t *pVM = NULL; + var_t *pResult = NULL; assert(f != NULL); assert(pMsg != NULL); @@ -995,7 +996,7 @@ static rsRetVal shouldProcessThisMessage(selector_t *f, msg_t *pMsg, int *bProce CHKiRet(vm.ExecProg(pVM, f->f_filterData.f_expr->pVmprg)); CHKiRet(vm.PopBoolFromStack(pVM, &pResult)); dbgprintf("result of expression evaluation: %lld\n", pResult->val.num); - CHKiRet(vm.Destruct(&pVM)); + /* VM is destructed on function exit */ bRet = (pResult->val.num) ? 1 : 0; } else { assert(f->f_filter_type == FILTER_PROP); /* assert() just in case... */ @@ -1051,6 +1052,12 @@ static rsRetVal shouldProcessThisMessage(selector_t *f, msg_t *pMsg, int *bProce } finalize_it: + /* destruct in any case, not just on error, but it makes error handling much easier */ + if(pVM != NULL) { + var.Destruct(&pResult); + vm.Destruct(&pVM); + } + *bProcessMsg = bRet; RETiRet; } @@ -2838,6 +2845,8 @@ InitGlobalClasses(void) CHKiRet(objUse(errmsg, CORE_COMPONENT)); pErrObj = "module"; CHKiRet(objUse(module, CORE_COMPONENT)); + pErrObj = "var"; + CHKiRet(objUse(var, CORE_COMPONENT)); /* initialize and use classes. We must be very careful with the order of events. Some * classes use others and if we do not initialize them in the right order, we may end diff --git a/var.c b/var.c index c1d66643..7de00d88 100644 --- a/var.c +++ b/var.c @@ -63,12 +63,11 @@ rsRetVal varConstructFinalize(var_t __attribute__((unused)) *pThis) BEGINobjDestruct(var) /* be sure to specify the object type also in END and CODESTART macros! */ CODESTARTobjDestruct(var) if(pThis->pcsName != NULL) - d_free(pThis->pcsName); + rsCStrDestruct(&pThis->pcsName); if(pThis->varType == VARTYPE_STR) { if(pThis->val.pStr != NULL) - d_free(pThis->val.pStr); + rsCStrDestruct(&pThis->val.pStr); } - ENDobjDestruct(var) @@ -192,10 +191,16 @@ ConvToNumber(var_t *pThis) } else if(pThis->varType == VARTYPE_STR) { iRet = rsCStrConvertToNumber(pThis->val.pStr, &n); if(iRet == RS_RET_NOT_A_NUMBER) { - n = 0; /* TODO: isn't it better to pass the error? */ + n = 0; + iRet = RS_RET_OK; /* we accept this as part of the language definition */ } else if (iRet != RS_RET_OK) { FINALIZE; } + + /* we need to destruct the string first, because string and number are + * inside a union and share the memory area! -- rgerhards, 2008-04-03 + */ + rsCStrDestruct(&pThis->val.pStr); pThis->val.num = n; pThis->varType = VARTYPE_NUMBER; @@ -244,7 +249,18 @@ ConvToBool(var_t *pThis) if(pThis->varType == VARTYPE_NUMBER) { FINALIZE; } else if(pThis->varType == VARTYPE_STR) { - CHKiRet(rsCStrConvertToBool(pThis->val.pStr, &n)); + iRet = rsCStrConvertToBool(pThis->val.pStr, &n); + if(iRet == RS_RET_NOT_A_NUMBER) { + n = 0; + iRet = RS_RET_OK; /* we accept this as part of the language definition */ + } else if (iRet != RS_RET_OK) { + FINALIZE; + } + + /* we need to destruct the string first, because string and number are + * inside a union and share the memory area! -- rgerhards, 2008-04-03 + */ + rsCStrDestruct(&pThis->val.pStr); pThis->val.num = n; pThis->varType = VARTYPE_NUMBER; } @@ -366,8 +382,6 @@ CODESTARTobjQueryInterface(var) * work here (if we can support an older interface version - that, * of course, also affects the "if" above). */ - //xxxpIf->oID = OBJvar; - pIf->Construct = varConstruct; pIf->ConstructFinalize = varConstructFinalize; pIf->Destruct = varDestruct; diff --git a/vm.c b/vm.c index 3cd05622..a26e4331 100644 --- a/vm.c +++ b/vm.c @@ -109,8 +109,6 @@ BEGINop(name) \ number_t bRes; \ CODESTARTop(name) \ CHKiRet(vmstk.Pop2CommOp(pThis->pStk, &operand1, &operand2)); \ -var.DebugPrint(operand1); \ -var.DebugPrint(operand2); \ /* data types are equal (so we look only at operand1), but we must \ * check which type we have to deal with... \ */ \ @@ -122,7 +120,6 @@ var.DebugPrint(operand2); \ } \ \ /* we have a result, so let's push it */ \ -RUNLOG_VAR("%lld", bRes); \ var.SetNumber(operand1, bRes); \ vmstk.Push(pThis->pStk, operand1); /* result */ \ var.Destruct(&operand2); /* no longer needed */ \ @@ -374,6 +371,8 @@ BEGINobjDestruct(vm) /* be sure to specify the object type also in END and CODES CODESTARTobjDestruct(vm) if(pThis->pStk != NULL) vmstk.Destruct(&pThis->pStk); + if(pThis->pMsg != NULL) + msgDestruct(&pThis->pMsg); ENDobjDestruct(vm) diff --git a/vmop.c b/vmop.c index affa83e7..91f84b91 100644 --- a/vmop.c +++ b/vmop.c @@ -59,6 +59,12 @@ rsRetVal vmopConstructFinalize(vmop_t __attribute__((unused)) *pThis) /* destructor for the vmop object */ BEGINobjDestruct(vmop) /* be sure to specify the object type also in END and CODESTART macros! */ CODESTARTobjDestruct(vmop) + if( pThis->opcode == opcode_PUSHSYSVAR + || pThis->opcode == opcode_PUSHMSGVAR + || pThis->opcode == opcode_PUSHCONSTANT) { + if(pThis->operand.pVar != NULL) + var.Destruct(&pThis->operand.pVar); + } ENDobjDestruct(vmop) diff --git a/vmstk.c b/vmstk.c index 9ca815ff..f6614f71 100644 --- a/vmstk.c +++ b/vmstk.c @@ -201,8 +201,6 @@ CODESTARTobjQueryInterface(vmstk) * work here (if we can support an older interface version - that, * of course, also affects the "if" above). */ - //xxxpIf->oID = OBJvmstk; - pIf->Construct = vmstkConstruct; pIf->ConstructFinalize = vmstkConstructFinalize; pIf->Destruct = vmstkDestruct; -- cgit v1.2.3 From 4419e1068aff9e88ed419f6439f577bb0960f7a0 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 3 Apr 2008 08:57:44 +0000 Subject: bugfix: $hostname and $fromhost in RainerScript did not work --- ChangeLog | 1 + msg.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index aef28847..5c60c5b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ Version 3.14.0 (rgerhards), 2008-04-02 - disabled atomic operations for this stable build as it caused platform problems - bugfix: memory leaks in script engine +- bugfix: $hostname and $fromhost in RainerScript did not work --------------------------------------------------------------------------- Version 3.13.0-dev0 (rgerhards), 2008-03-31 - bugfix: accidently set debug option in 3.12.5 reset to production diff --git a/msg.c b/msg.c index 76ea2f72..7c020a61 100644 --- a/msg.c +++ b/msg.c @@ -1606,9 +1606,11 @@ char *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, pRes = getRawMsg(pMsg); } else if(!strcmp((char*) pName, "UxTradMsg")) { pRes = getUxTradMsg(pMsg); - } else if(!strcmp((char*) pName, "FROMHOST")) { + } else if( !strcmp((char*) pName, "FROMHOST") + || !strcmp((char*) pName, "fromhost")) { pRes = getRcvFrom(pMsg); } else if(!strcmp((char*) pName, "source") + || !strcmp((char*) pName, "hostname") || !strcmp((char*) pName, "HOSTNAME")) { pRes = getHOSTNAME(pMsg); } else if(!strcmp((char*) pName, "syslogtag")) { -- cgit v1.2.3 From 6b982c8e5dbfd54eff7e22291d7f63400ff3c555 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 3 Apr 2008 09:14:05 +0000 Subject: bugfix: $hostname and $fromhost in RainerScript did not work --- ChangeLog | 1 + msg.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 66994c28..21f330e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ Version 3.15.1 (rgerhards), 2008-04-?? - added more meaningful error messages to rsyslogd (when some errors happens during startup) - bugfix: memory leaks in script engine +- bugfix: $hostname and $fromhost in RainerScript did not work --------------------------------------------------------------------------- Version 3.15.0 (rgerhards), 2008-04-01 - major new feature: imrelp/omrelp support reliable delivery of syslog diff --git a/msg.c b/msg.c index 76ea2f72..7c020a61 100644 --- a/msg.c +++ b/msg.c @@ -1606,9 +1606,11 @@ char *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, pRes = getRawMsg(pMsg); } else if(!strcmp((char*) pName, "UxTradMsg")) { pRes = getUxTradMsg(pMsg); - } else if(!strcmp((char*) pName, "FROMHOST")) { + } else if( !strcmp((char*) pName, "FROMHOST") + || !strcmp((char*) pName, "fromhost")) { pRes = getRcvFrom(pMsg); } else if(!strcmp((char*) pName, "source") + || !strcmp((char*) pName, "hostname") || !strcmp((char*) pName, "HOSTNAME")) { pRes = getHOSTNAME(pMsg); } else if(!strcmp((char*) pName, "syslogtag")) { -- cgit v1.2.3 From 4ec54f46166c33ee96bdc9d271b4a3610d6007bd Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 3 Apr 2008 13:56:36 +0000 Subject: bugfix: some memory leak when queue is runing in disk mode --- ChangeLog | 1 + obj.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5c60c5b8..3b86aaf5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ Version 3.14.0 (rgerhards), 2008-04-02 platform problems - bugfix: memory leaks in script engine - bugfix: $hostname and $fromhost in RainerScript did not work +- bugfix: some memory leak when queue is runing in disk mode --------------------------------------------------------------------------- Version 3.13.0-dev0 (rgerhards), 2008-03-31 - bugfix: accidently set debug option in 3.12.5 reset to production diff --git a/obj.c b/obj.c index 0baaf7a1..d408c4bb 100644 --- a/obj.c +++ b/obj.c @@ -731,7 +731,7 @@ finalize_it: static rsRetVal objDeserializeProperties(obj_t *pObj, objInfo_t *pObjInfo, strm_t *pStrm) { DEFiRet; - var_t *pVar; + var_t *pVar = NULL; ISOBJ_assert(pObj); ISOBJ_TYPE_assert(pStrm, strm); @@ -743,15 +743,23 @@ static rsRetVal objDeserializeProperties(obj_t *pObj, objInfo_t *pObjInfo, strm_ iRet = objDeserializeProperty(pVar, pStrm); while(iRet == RS_RET_OK) { CHKiRet(pObjInfo->objMethods[objMethod_SETPROPERTY](pObj, pVar)); + /* re-init var object - TODO: method of var! */ + rsCStrDestruct(&pVar->pcsName); /* no longer needed */ + if(pVar->varType == VARTYPE_STR) { + if(pVar->val.pStr != NULL) + rsCStrDestruct(&pVar->val.pStr); + } iRet = objDeserializeProperty(pVar, pStrm); } - var.Destruct(&pVar); if(iRet != RS_RET_NO_PROPLINE) FINALIZE; CHKiRet(objDeserializeTrailer(pStrm)); /* do trailer checks */ finalize_it: + if(pVar != NULL) + var.Destruct(&pVar); + RETiRet; } -- cgit v1.2.3 From 61931c57c39de8d2dbeb0a6a6d27e2762e1821d4 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 3 Apr 2008 13:57:18 +0000 Subject: bugfix: some memory leak when queue is runing in disk mode --- ChangeLog | 1 + obj.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 21f330e7..40774e36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ Version 3.15.1 (rgerhards), 2008-04-?? happens during startup) - bugfix: memory leaks in script engine - bugfix: $hostname and $fromhost in RainerScript did not work +- bugfix: some memory leak when queue is runing in disk mode --------------------------------------------------------------------------- Version 3.15.0 (rgerhards), 2008-04-01 - major new feature: imrelp/omrelp support reliable delivery of syslog diff --git a/obj.c b/obj.c index 0baaf7a1..d408c4bb 100644 --- a/obj.c +++ b/obj.c @@ -731,7 +731,7 @@ finalize_it: static rsRetVal objDeserializeProperties(obj_t *pObj, objInfo_t *pObjInfo, strm_t *pStrm) { DEFiRet; - var_t *pVar; + var_t *pVar = NULL; ISOBJ_assert(pObj); ISOBJ_TYPE_assert(pStrm, strm); @@ -743,15 +743,23 @@ static rsRetVal objDeserializeProperties(obj_t *pObj, objInfo_t *pObjInfo, strm_ iRet = objDeserializeProperty(pVar, pStrm); while(iRet == RS_RET_OK) { CHKiRet(pObjInfo->objMethods[objMethod_SETPROPERTY](pObj, pVar)); + /* re-init var object - TODO: method of var! */ + rsCStrDestruct(&pVar->pcsName); /* no longer needed */ + if(pVar->varType == VARTYPE_STR) { + if(pVar->val.pStr != NULL) + rsCStrDestruct(&pVar->val.pStr); + } iRet = objDeserializeProperty(pVar, pStrm); } - var.Destruct(&pVar); if(iRet != RS_RET_NO_PROPLINE) FINALIZE; CHKiRet(objDeserializeTrailer(pStrm)); /* do trailer checks */ finalize_it: + if(pVar != NULL) + var.Destruct(&pVar); + RETiRet; } -- cgit v1.2.3 From f71c32668773bd37892b4f587078b3aebc8c7949 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 3 Apr 2008 14:53:11 +0000 Subject: man pages improved thanks to varmofekoj and Peter Vrabec --- ChangeLog | 1 + rsyslog.conf.5 | 62 ++++++++++++++++++++++++++++- rsyslogd.8 | 123 +++++++++++++++++++++++++++++++++++---------------------- 3 files changed, 137 insertions(+), 49 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b86aaf5..dc333afe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ Version 3.14.0 (rgerhards), 2008-04-02 - bugfix: memory leaks in script engine - bugfix: $hostname and $fromhost in RainerScript did not work - bugfix: some memory leak when queue is runing in disk mode +- man pages improved thanks to varmofekoj and Peter Vrabec --------------------------------------------------------------------------- Version 3.13.0-dev0 (rgerhards), 2008-03-31 - bugfix: accidently set debug option in 3.12.5 reset to production diff --git a/rsyslog.conf.5 b/rsyslog.conf.5 index d7116678..d672a692 100644 --- a/rsyslog.conf.5 +++ b/rsyslog.conf.5 @@ -17,7 +17,7 @@ .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. .\" -.TH RSYSLOG.CONF 5 "02 April 2008" "Version 3.14.0" "Linux System Administration" +.TH RSYSLOG.CONF 5 "03 April 2008" "Version 3.14.0" "Linux System Administration" .SH NAME rsyslog.conf \- rsyslogd(8) configuration file .SH DESCRIPTION @@ -40,6 +40,66 @@ to look at the html documentation, because the man pages only cover basic aspects of operation. +.SH MODULES + +Rsyslog has a modular design. Consequently, there is a growing number +of modules. See the html documentation for their full description. + +.TP +.I omsnmp +SNMP trap output module +.TP +.I omrelp +RELP output module +.TP +.I omgssapi +Output module for GSS-enabled syslog +.TP +.I ommysql +Output module for MySQL +.TP +.I ompgsql +Output module for PostgreSQL +.TP +.I omlibdbi +Generic database output module (Firebird/Interbase, MS SQL, Sybase, +SQLLite, Ingres, Oracle, mSQL) +.TP +.I imfile +Input module for text files +.TP +.I imrelp +RELP input module +.TP +.I imudp +Input plugin for UDP syslog. Replaces the deprecated -r option. Can be +used like this: +.IP +$ModLoad imudp +.IP +$InputUDPServerRun 514 +.TP +.I imtcp +Input plugin for plain TCP syslog. Replaces the deprecated -t +option. Can be used like this: +.IP +$ModLoad imtcp +.IP +$InputTCPServerRun 514 +.TP +.I imgssapi +Input plugin for plain TCP and GSS-enable syslog +.TP +.I immark +Dupport for mark messages +.TP +.I imklog +Kernel logging +.TP +.I imuxsock +Unix sockets, including the system log socket + + .SH BASIC STRUCTURE Lines starting with a hash mark ('#') and empty lines are ignored. diff --git a/rsyslogd.8 b/rsyslogd.8 index 28fa6bb1..0125d589 100644 --- a/rsyslogd.8 +++ b/rsyslogd.8 @@ -45,6 +45,8 @@ To use rsyslog's advanced features, you .B need to look at the html documentation, because the man pages only cover basic aspects of operation. +.B For details and configuration examples, see the rsyslog.conf (5) +.B man page and the online documentation at http://www.rsyslog.com/doc .BR Rsyslogd (8) is derived from the sysklogd package which in turn is derived from the @@ -83,11 +85,11 @@ option, is read at startup. Any lines that begin with the hash mark (``#'') and empty lines are ignored. If an error occurs during parsing the error element is ignored. It is tried to parse the rest of the line. -For details and configuration examples, see the -.B rsyslog.conf (5) -man page. .LP .SH OPTIONS +.B Note that in version 3 of rsyslog a number of command line options +.B have been deprecated and replaced with config file directives. The +.B -c option controls the backward compatibility mode in use. .TP .BI "\-A" When sending UDP messages, there are potentially multiple pathes to @@ -114,6 +116,28 @@ If neither -4 nor -6 is given, .B rsyslogd listens to all configured addresses of the system. .TP +.BI "\-c " "version" +Selects the desired backward compatibility mode. It must always be the +first option on the command line, as it influences processing of the +other options. To use the rsyslog v3 native interface, specify -c3. To +use compatibility mode , either do not use -c at all or use +-c where +.IR version +is the rsyslog version that it shall be +compatible with. Using -c0 tells rsyslog to be command-line compatible +to sysklogd, which is the default if -c is not given. +.B Please note that rsyslogd issues warning messages if the -c3 +.B command line option is not given. +This is to alert you that your are running in compatibility +mode. Compatibility mode interfers with you rsyslog.conf commands and +may cause some undesired side-effects. It is meant to be used with a +plain old rsyslog.conf - if you use new features, things become +messy. So the best advice is to work through this document, convert +your options and config file and then use rsyslog in native mode. In +order to aid you in this process, rsyslog logs every +compatibility-mode config file directive it has generated. So you can +simply copy them from your logfile and paste them to the config. +.TP .B "\-d" Turns on debug mode. Using this the daemon will not proceed a .BR fork (2) @@ -214,51 +238,6 @@ debug option. .B CHLD Wait for childs if some were born, because of wall'ing messages. .LP -.SH SUPPORT FOR REMOTE LOGGING -.B Rsyslogd -provides network support to the syslogd facility. -Network support means that messages can be forwarded from one node -running rsyslogd to another node running rsyslogd (or a -compatible syslog implementation). -actually logged to a disk file. - -To enable this, proper configuration commands must -be entered in rsyslog.conf. See the rsyslog.conf html -documentation for details. - -The strategy is to have rsyslogd listen on a unix domain socket for -locally generated log messages. This behavior will allow rsyslogd to -inter-operate with the syslog found in the standard C library. At the -same time rsyslogd listens on the standard syslog port for messages -forwarded from other hosts. - -.SH OUTPUT TO DATABASES -.B Rsyslogd -has support for writing data to database tables. The exact specifics -are described in the -.B rsyslog.conf (5) -html documentation. Be sure to read it if you plan to use database logging. - -.SH OUTPUT TO NAMED PIPES (FIFOs) -.B Rsyslogd -has support for logging output to named pipes -(fifos). A fifo or named pipe can be used as a destination for log -messages by prepending a pipy symbol (``|'') to the name of the -file. This is handy for debugging. Note that the fifo must be created -with the mkfifo command before -.B rsyslogd -is started. -.IP -The following configuration file routes debug messages from the -kernel to a fifo: -.IP -.nf - # Sample configuration to route kernel debugging - # messages ONLY to /usr/adm/debug which is a - # named pipe. - kern.=debug |/usr/adm/debug -.fi -.LP .SH SECURITY THREATS There is the potential for the rsyslogd daemon to be used as a conduit for a denial of service attack. @@ -314,6 +293,54 @@ The Unix domain socket to from where local syslog messages are read. .I /var/run/rsyslogd.pid The file containing the process id of .BR rsyslogd . +.TP +.I prefix/lib/rsyslog +Default directory for +.B rsyslogd +modules. The +.I prefix +is specified during compilation (e.g. /usr/local). +.SH ENVIRONMENT +.TP +.B RSYSLOG_DEBUG +Controls runtime debug support.It contains an option string with the +following options possible (all are case insensitive): + +.RS +.IP LogFuncFlow +Print out the logical flow of functions (entering and exiting them) +.IP FileTrace +Ppecifies which files to trace LogFuncFlow. If not set (the +default), a LogFuncFlow trace is provided for all files. Set to +limit it to the files specified.FileTrace may be specified multiple +times, one file each (e.g. export RSYSLOG_DEBUG="LogFuncFlow +FileTrace=vm.c FileTrace=expr.c" +.IP PrintFuncDB +Print the content of the debug function database whenever debug +information is printed (e.g. abort case)! +.IP PrintAllDebugInfoOnExit +Print all debug information immediately before rsyslogd exits +(currently not implemented!) +.IP PrintMutexAction +Print mutex action as it happens. Useful for finding deadlocks and +such. +.IP NoLogTimeStamp +Do not prefix log lines with a timestamp (default is to do that). +.IP NoStdOut +Do not emit debug messages to stdout. If RSYSLOG_DEBUGLOG is not +set, this means no messages will be displayed at all. +.IP Help +Display a very short list of commands - hopefully a life saver if +you can't access the documentation... +.RE + +.TP +.B RSYSLOG_DEBUGLOG +If set, writes (allmost) all debug message to the specified log file +in addition to stdout. +.TP +.B RSYSLOG_MODDIR +Provides the default directory in which loadable modules reside. .PD .SH BUGS Please review the file BUGS for up-to-date information on known -- cgit v1.2.3 From d90258ba84718cbff684a3d8eba22156c8487a1e Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 3 Apr 2008 16:41:22 +0000 Subject: removed accidently addded lines --- queue.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/queue.c b/queue.c index 7ae5815d..ed720c55 100644 --- a/queue.c +++ b/queue.c @@ -2208,8 +2208,6 @@ rsRetVal queueQueryInterface(void) { return RS_RET_NOT_IMPLEMENTED; } */ BEGINObjClassInit(queue, 1, OBJ_IS_CORE_MODULE) /* request objects we use */ -DEFpropSetMeth(queue, iDeqtWinFromHr, int); -DEFpropSetMeth(queue, iDeqtWinToHr, int); /* now set our own handlers */ OBJSetMethodHandler(objMethod_SETPROPERTY, queueSetProperty); -- cgit v1.2.3 From affcef6b121d9014eb7cc9c2bcfc20a2b0bcb2fd Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 3 Apr 2008 17:00:59 +0000 Subject: some more man updates --- rsyslog.conf.5 | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/rsyslog.conf.5 b/rsyslog.conf.5 index d672a692..3c42288c 100644 --- a/rsyslog.conf.5 +++ b/rsyslog.conf.5 @@ -49,9 +49,6 @@ of modules. See the html documentation for their full description. .I omsnmp SNMP trap output module .TP -.I omrelp -RELP output module -.TP .I omgssapi Output module for GSS-enabled syslog .TP @@ -68,9 +65,6 @@ SQLLite, Ingres, Oracle, mSQL) .I imfile Input module for text files .TP -.I imrelp -RELP input module -.TP .I imudp Input plugin for UDP syslog. Replaces the deprecated -r option. Can be used like this: @@ -91,13 +85,24 @@ $InputTCPServerRun 514 Input plugin for plain TCP and GSS-enable syslog .TP .I immark -Dupport for mark messages +Support for mark messages .TP .I imklog -Kernel logging +Kernel logging. To include kernel log messages, you need to do +.IP +$ModLoad imklog + +Please note that the klogd daemon is no longer necessary and consequently +no longer provided by the rsyslog package. .TP .I imuxsock -Unix sockets, including the system log socket +Unix sockets, including the system log socket. You need to specify +.IP +$ModLoad imudp + +in order to receive log messages from local system processes. This +config directive should only left out if you know exactly what you +are doing. .SH BASIC STRUCTURE @@ -142,7 +147,16 @@ beginning with a slash ('/'). .B Example: .RS -*.* /var/log/traditionalfile.log;TraditionalFormat # log to a file in the traditional format +*.* /var/log/traditionalfile.log;RSYSLOG_TraditionalFormat # log to a file in the traditional format +.RE + +Note: if you would like to use high-precision timestamps in your log files, +just remove the ";RSYSLOG_TraditionalFormat". That will select the default +template, which, if not changed, uses RFC 3339 timestamps. + +.B Example: +.RS +*.* /var/log/file.log # log to a file with RFC3339 timestamps .RE .SS Named pipes @@ -670,7 +684,6 @@ the html documentation for all features and details. This is especially vital if up a more-then-extremely-simple system. .SH AUTHORS -The .B rsyslogd is taken from sysklogd sources, which have been heavily modified by Rainer Gerhards (rgerhards@adiscon.com) and others. -- cgit v1.2.3 From 6d306efe32d5d1efbfedbedf0177e469195592ad Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 4 Apr 2008 06:24:29 +0000 Subject: added RELP doc to man pages --- rsyslog.conf.5 | 126 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- rsyslogd.8 | 125 ++++++++++++++++++++++++++++++++++---------------------- 2 files changed, 195 insertions(+), 56 deletions(-) diff --git a/rsyslog.conf.5 b/rsyslog.conf.5 index e673e490..e15a4549 100644 --- a/rsyslog.conf.5 +++ b/rsyslog.conf.5 @@ -17,7 +17,7 @@ .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. .\" -.TH RSYSLOG.CONF 5 "28 March 2008" "Version 3.12.5" "Linux System Administration" +.TH RSYSLOG.CONF 5 "04 April 2008" "Version 3.15.0" "Linux System Administration" .SH NAME rsyslog.conf \- rsyslogd(8) configuration file .SH DESCRIPTION @@ -40,6 +40,94 @@ to look at the html documentation, because the man pages only cover basic aspects of operation. +.SH MODULES + +Rsyslog has a modular design. Consequently, there is a growing number +of modules. See the html documentation for their full description. + +.TP +.I omsnmp +SNMP trap output module +.TP +.I omgssapi +Output module for GSS-enabled syslog +.TP +.I ommysql +Output module for MySQL +.TP +.I omprelp +Output module for the reliable RELP protocol (prevents message loss). +For details, see below at imrelp and the html documentation. +It can be used like this: +.IP +*.* :omrelp:server:port +.IP +*.* :omrelp:192.168.0.1:2514 # actual sample +.TP +.I ompgsql +Output module for PostgreSQL +.TP +.I omlibdbi +Generic database output module (Firebird/Interbase, MS SQL, Sybase, +SQLLite, Ingres, Oracle, mSQL) +.TP +.I imfile +Input module for text files +.TP +.I imudp +Input plugin for UDP syslog. Replaces the deprecated -r option. Can be +used like this: +.IP +$ModLoad imudp +.IP +$InputUDPServerRun 514 +.TP +.I imtcp +Input plugin for plain TCP syslog. Replaces the deprecated -t +option. Can be used like this: +.IP +$ModLoad imtcp +.IP +$InputTCPServerRun 514 +.TP +.TP +.I imtcp +Input plugin for the RELP protocol. RELP can be used instead +of UDP or plain TCP syslog to provide reliable delivery of +syslog messages. Please note that plain TCP syslog does NOT +provide truly reliable delivery, with it messages may be lost +when there is a connection problem or the server shuts down. +RELP prevents message loss in those cases. +It can be used like this: +.IP +$ModLoad imrelp +.IP +$InputRELPServerRun 2514 +.TP +.I imgssapi +Input plugin for plain TCP and GSS-enable syslog +.TP +.I immark +Support for mark messages +.TP +.I imklog +Kernel logging. To include kernel log messages, you need to do +.IP +$ModLoad imklog + +Please note that the klogd daemon is no longer necessary and consequently +no longer provided by the rsyslog package. +.TP +.I imuxsock +Unix sockets, including the system log socket. You need to specify +.IP +$ModLoad imudp + +in order to receive log messages from local system processes. This +config directive should only left out if you know exactly what you +are doing. + + .SH BASIC STRUCTURE Lines starting with a hash mark ('#') and empty lines are ignored. @@ -82,7 +170,16 @@ beginning with a slash ('/'). .B Example: .RS -*.* /var/log/traditionalfile.log;TraditionalFormat # log to a file in the traditional format +*.* /var/log/traditionalfile.log;RSYSLOG_TraditionalFormat # log to a file in the traditional format +.RE + +Note: if you would like to use high-precision timestamps in your log files, +just remove the ";RSYSLOG_TraditionalFormat". That will select the default +template, which, if not changed, uses RFC 3339 timestamps. + +.B Example: +.RS +*.* /var/log/file.log # log to a file with RFC3339 timestamps .RE .SS Named pipes @@ -95,9 +192,14 @@ the mkfifo(1) command before rsyslogd(8) is started. If the file you specified is a tty, special tty-handling is done, same with /dev/console. .SS Remote machine -To forward messages to another host, prepend the hostname with the at sign ("@"). A single at -sign means that messages will be forwarded via UDP protocol (the standard for syslog). If you -prepend two at signs ("@@"), the messages will be transmitted via TCP. +There are three ways to forward message: the traditional UDP transport, which is extremely +lossy but standard, the plain TCP based transport which loses messages only during certain +situations but is widely available and the RELP transport which does not lose messages +but is currently available only as part of rsyslogd 3.15.0 and above. + +To forward messages to another host via UDP, prepend the hostname with the at sign ("@"). +To forward it via plain tcp, prepend two at signs ("@@"). To forward via RELP, prepend the +string ":omrelp:" in front of the hostname. .B Example: .RS @@ -105,7 +207,18 @@ prepend two at signs ("@@"), the messages will be transmitted via TCP. .RE .sp In the example above, messages are forwarded via UDP to the machine 192.168.0.1, the destination -port defaults to 514. +port defaults to 514. Due to the nature of UDP, you will probably lose some messages in transit. +If you expect high traffic volume, you can expect to lose a quite noticable number of messages +(the higher the traffic, the more likely and severe is message loss). + +.B If you would like to prevent message loss, use RELP: +.RS +*.* :omrelp:192.168.0.1:2514 +.RE +.sp +Note that a port number was given as there is no standard port for relp. + +Keep in mind that you need to load the correct input and output plugins (see "Modules" above). Please note that rsyslogd offers a variety of options in regarding to remote forwarding. For full details, please see the html documentation. @@ -610,7 +723,6 @@ the html documentation for all features and details. This is especially vital if up a more-then-extremely-simple system. .SH AUTHORS -The .B rsyslogd is taken from sysklogd sources, which have been heavily modified by Rainer Gerhards (rgerhards@adiscon.com) and others. diff --git a/rsyslogd.8 b/rsyslogd.8 index 353fb4c0..0125d589 100644 --- a/rsyslogd.8 +++ b/rsyslogd.8 @@ -1,7 +1,7 @@ .\" Copyright 2004-2008 Rainer Gerhards and Adiscon for the rsyslog modifications .\" May be distributed under the GNU General Public License .\" -.TH RSYSLOGD 8 "28 March 2008" "Version 3.12.5 (devel)" "Linux System Administration" +.TH RSYSLOGD 8 "02 April 2008" "Version 3.14.0" "Linux System Administration" .SH NAME rsyslogd \- reliable and extended syslogd .SH SYNOPSIS @@ -45,6 +45,8 @@ To use rsyslog's advanced features, you .B need to look at the html documentation, because the man pages only cover basic aspects of operation. +.B For details and configuration examples, see the rsyslog.conf (5) +.B man page and the online documentation at http://www.rsyslog.com/doc .BR Rsyslogd (8) is derived from the sysklogd package which in turn is derived from the @@ -83,11 +85,11 @@ option, is read at startup. Any lines that begin with the hash mark (``#'') and empty lines are ignored. If an error occurs during parsing the error element is ignored. It is tried to parse the rest of the line. -For details and configuration examples, see the -.B rsyslog.conf (5) -man page. .LP .SH OPTIONS +.B Note that in version 3 of rsyslog a number of command line options +.B have been deprecated and replaced with config file directives. The +.B -c option controls the backward compatibility mode in use. .TP .BI "\-A" When sending UDP messages, there are potentially multiple pathes to @@ -114,6 +116,28 @@ If neither -4 nor -6 is given, .B rsyslogd listens to all configured addresses of the system. .TP +.BI "\-c " "version" +Selects the desired backward compatibility mode. It must always be the +first option on the command line, as it influences processing of the +other options. To use the rsyslog v3 native interface, specify -c3. To +use compatibility mode , either do not use -c at all or use +-c where +.IR version +is the rsyslog version that it shall be +compatible with. Using -c0 tells rsyslog to be command-line compatible +to sysklogd, which is the default if -c is not given. +.B Please note that rsyslogd issues warning messages if the -c3 +.B command line option is not given. +This is to alert you that your are running in compatibility +mode. Compatibility mode interfers with you rsyslog.conf commands and +may cause some undesired side-effects. It is meant to be used with a +plain old rsyslog.conf - if you use new features, things become +messy. So the best advice is to work through this document, convert +your options and config file and then use rsyslog in native mode. In +order to aid you in this process, rsyslog logs every +compatibility-mode config file directive it has generated. So you can +simply copy them from your logfile and paste them to the config. +.TP .B "\-d" Turns on debug mode. Using this the daemon will not proceed a .BR fork (2) @@ -214,51 +238,6 @@ debug option. .B CHLD Wait for childs if some were born, because of wall'ing messages. .LP -.SH SUPPORT FOR REMOTE LOGGING -.B Rsyslogd -provides network support to the syslogd facility. -Network support means that messages can be forwarded from one node -running rsyslogd to another node running rsyslogd (or a -compatible syslog implementation). -actually logged to a disk file. - -To enable this, proper configuration commands must -be entered in rsyslog.conf. See the rsyslog.conf html -documentation for details. - -The strategy is to have rsyslogd listen on a unix domain socket for -locally generated log messages. This behavior will allow rsyslogd to -inter-operate with the syslog found in the standard C library. At the -same time rsyslogd listens on the standard syslog port for messages -forwarded from other hosts. - -.SH OUTPUT TO DATABASES -.B Rsyslogd -has support for writing data to database tables. The exact specifics -are described in the -.B rsyslog.conf (5) -html documentation. Be sure to read it if you plan to use database logging. - -.SH OUTPUT TO NAMED PIPES (FIFOs) -.B Rsyslogd -has support for logging output to named pipes -(fifos). A fifo or named pipe can be used as a destination for log -messages by prepending a pipy symbol (``|'') to the name of the -file. This is handy for debugging. Note that the fifo must be created -with the mkfifo command before -.B rsyslogd -is started. -.IP -The following configuration file routes debug messages from the -kernel to a fifo: -.IP -.nf - # Sample configuration to route kernel debugging - # messages ONLY to /usr/adm/debug which is a - # named pipe. - kern.=debug |/usr/adm/debug -.fi -.LP .SH SECURITY THREATS There is the potential for the rsyslogd daemon to be used as a conduit for a denial of service attack. @@ -314,6 +293,54 @@ The Unix domain socket to from where local syslog messages are read. .I /var/run/rsyslogd.pid The file containing the process id of .BR rsyslogd . +.TP +.I prefix/lib/rsyslog +Default directory for +.B rsyslogd +modules. The +.I prefix +is specified during compilation (e.g. /usr/local). +.SH ENVIRONMENT +.TP +.B RSYSLOG_DEBUG +Controls runtime debug support.It contains an option string with the +following options possible (all are case insensitive): + +.RS +.IP LogFuncFlow +Print out the logical flow of functions (entering and exiting them) +.IP FileTrace +Ppecifies which files to trace LogFuncFlow. If not set (the +default), a LogFuncFlow trace is provided for all files. Set to +limit it to the files specified.FileTrace may be specified multiple +times, one file each (e.g. export RSYSLOG_DEBUG="LogFuncFlow +FileTrace=vm.c FileTrace=expr.c" +.IP PrintFuncDB +Print the content of the debug function database whenever debug +information is printed (e.g. abort case)! +.IP PrintAllDebugInfoOnExit +Print all debug information immediately before rsyslogd exits +(currently not implemented!) +.IP PrintMutexAction +Print mutex action as it happens. Useful for finding deadlocks and +such. +.IP NoLogTimeStamp +Do not prefix log lines with a timestamp (default is to do that). +.IP NoStdOut +Do not emit debug messages to stdout. If RSYSLOG_DEBUGLOG is not +set, this means no messages will be displayed at all. +.IP Help +Display a very short list of commands - hopefully a life saver if +you can't access the documentation... +.RE + +.TP +.B RSYSLOG_DEBUGLOG +If set, writes (allmost) all debug message to the specified log file +in addition to stdout. +.TP +.B RSYSLOG_MODDIR +Provides the default directory in which loadable modules reside. .PD .SH BUGS Please review the file BUGS for up-to-date information on known -- cgit v1.2.3 From 798acf51b482387a2702bd4064d538d7b3bedaa3 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 4 Apr 2008 06:57:54 +0000 Subject: removed the 32 character size limit (from RFC3164) on the tag. This had bad effects on existing envrionments, as sysklogd didn't obey it either (probably another bug in RFC3164...). We now receive the full size, but will modify the outputs so that only 32 characters max are used by default. If you need large tags in the output, you need to provide custom templates. --- ChangeLog | 6 ++++++ syslogd.c | 22 +++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 40774e36..5926cc3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,12 @@ Version 3.15.1 (rgerhards), 2008-04-?? happens during startup) - bugfix: memory leaks in script engine - bugfix: $hostname and $fromhost in RainerScript did not work +- We have removed the 32 character size limit (from RFC3164) on the + tag. This had bad effects on existing envrionments, as sysklogd didn't + obey it either (probably another bug in RFC3164...). We now receive + the full size, but will modify the outputs so that only 32 characters + max are used by default. If you need large tags in the output, you need + to provide custom templates. - bugfix: some memory leak when queue is runing in disk mode --------------------------------------------------------------------------- Version 3.15.0 (rgerhards), 2008-04-01 diff --git a/syslogd.c b/syslogd.c index b5554e5f..99020a5f 100644 --- a/syslogd.c +++ b/syslogd.c @@ -422,8 +422,8 @@ static uchar template_SyslogProtocol23Format[] = "\"<%PRI%>1 %TIMESTAMP:::date-r static uchar template_TraditionalFileFormat[] = "\"%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::drop-last-lf%\n\""; static uchar template_FileFormat[] = "\"%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogtag%%msg:::drop-last-lf%\n\""; static uchar template_WallFmt[] = "\"\r\n\7Message from syslogd@%HOSTNAME% at %timegenerated% ...\r\n %syslogtag%%msg%\n\r\""; -static uchar template_ForwardFormat[] = "\"<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogtag%%msg%\""; -static uchar template_TraditionalForwardFormat[] = "\"<%PRI%>%TIMESTAMP% %HOSTNAME% %syslogtag%%msg%\""; +static uchar template_ForwardFormat[] = "\"<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogtag:1:32%%msg%\""; +static uchar template_TraditionalForwardFormat[] = "\"<%PRI%>%TIMESTAMP% %HOSTNAME% %syslogtag:1:32%%msg%\""; static uchar template_StdUsrMsgFmt[] = "\" %syslogtag%%msg%\n\r\""; static uchar template_StdDBFmt[] = "\"insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%HOSTNAME%', %syslogpriority%, '%timereported:::date-mysql%', '%timegenerated:::date-mysql%', %iut%, '%syslogtag%')\",SQL"; static uchar template_StdPgSQLFmt[] = "\"insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%HOSTNAME%', %syslogpriority%, '%timereported:::date-pgsql%', '%timegenerated:::date-pgsql%', %iut%, '%syslogtag%')\",STDSQL"; @@ -1408,7 +1408,6 @@ static int parseLegacySyslogMsg(msg_t *pMsg, int flags) * machine that we received the message from and the tag will be empty. This * is meant to be an interim solution, but for now it is in the code. */ - if(bParseHOSTNAMEandTAG && !(flags & INTERNAL_MSG)) { /* parse HOSTNAME - but only if this is network-received! * rger, 2005-11-14: we still have a problem with BSD messages. These messages @@ -1466,16 +1465,18 @@ static int parseLegacySyslogMsg(msg_t *pMsg, int flags) MsgSetHOSTNAME(pMsg, getRcvFrom(pMsg)); } - /* now parse TAG - that should be present in message from - * all sources. + /* now parse TAG - that should be present in message from all sources. * This code is somewhat not compliant with RFC 3164. As of 3164, * the TAG field is ended by any non-alphanumeric character. In * practice, however, the TAG often contains dashes and other things, * which would end the TAG. So it is not desirable. As such, we only * accept colon and SP to be terminators. Even there is a slight difference: * a colon is PART of the TAG, while a SP is NOT part of the tag - * (it is CONTENT). Finally, we allow only up to 32 characters for - * TAG, as it is specified in RFC 3164. + * (it is CONTENT). Starting 2008-04-04, we have removed the 32 character + * size limit (from RFC3164) on the tag. This had bad effects on existing + * envrionments, as sysklogd didn't obey it either (probably another bug + * in RFC3164...). We now receive the full size, but will modify the + * outputs so that only 32 characters max are used by default. */ /* The following code in general is quick & dirty - I need to get * it going for a test, rgerhards 2004-11-16 */ @@ -1489,15 +1490,10 @@ static int parseLegacySyslogMsg(msg_t *pMsg, int flags) rsCStrSetAllocIncrement(pStrB, 33); pWork = pBuf; iCnt = 0; - while(*p2parse && *p2parse != ':' && *p2parse != ' ' && iCnt < 32) { + while(*p2parse && *p2parse != ':' && *p2parse != ' ') { rsCStrAppendChar(pStrB, *p2parse++); ++iCnt; } - if (iCnt == 32) { - while(*p2parse && *p2parse != ':' && *p2parse != ' ') { - ++p2parse; - } - } if(*p2parse == ':') { ++p2parse; rsCStrAppendChar(pStrB, ':'); -- cgit v1.2.3 From c3d20d39fdca2e5fd9c08f13ef5ab15c4e9ad6ae Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 4 Apr 2008 09:46:54 +0000 Subject: removed the 32 character size limit (from RFC3164) on the tag. This had bad effects on existing envrionments, as sysklogd didn't obey it either (probably another bug in RFC3164...). We now receive the full size, but will modify the outputs so that only 32 characters max are used by default. If you need large tags in the output, you need to provide custom templates. --- ChangeLog | 8 +++++++- syslogd.c | 22 +++++++++------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index dc333afe..92585e19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,5 @@ --------------------------------------------------------------------------- -Version 3.14.0 (rgerhards), 2008-04-02 +Version 3.14.0 (rgerhards), 2008-04-04 - bugfix: rsyslogd was no longer build by default; man pages are only installed if corresponding option is selected. Thanks to Michael Biebl for pointing these problems out. @@ -9,6 +9,12 @@ Version 3.14.0 (rgerhards), 2008-04-02 - bugfix: $hostname and $fromhost in RainerScript did not work - bugfix: some memory leak when queue is runing in disk mode - man pages improved thanks to varmofekoj and Peter Vrabec +- We have removed the 32 character size limit (from RFC3164) on the + tag. This had bad effects on existing envrionments, as sysklogd didn't + obey it either (probably another bug in RFC3164...). We now receive + the full size, but will modify the outputs so that only 32 characters + max are used by default. If you need large tags in the output, you need + to provide custom templates. --------------------------------------------------------------------------- Version 3.13.0-dev0 (rgerhards), 2008-03-31 - bugfix: accidently set debug option in 3.12.5 reset to production diff --git a/syslogd.c b/syslogd.c index 4bed94c8..99e0efcc 100644 --- a/syslogd.c +++ b/syslogd.c @@ -422,8 +422,8 @@ static uchar template_SyslogProtocol23Format[] = "\"<%PRI%>1 %TIMESTAMP:::date-r static uchar template_TraditionalFileFormat[] = "\"%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::drop-last-lf%\n\""; static uchar template_FileFormat[] = "\"%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogtag%%msg:::drop-last-lf%\n\""; static uchar template_WallFmt[] = "\"\r\n\7Message from syslogd@%HOSTNAME% at %timegenerated% ...\r\n %syslogtag%%msg%\n\r\""; -static uchar template_ForwardFormat[] = "\"<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogtag%%msg%\""; -static uchar template_TraditionalForwardFormat[] = "\"<%PRI%>%TIMESTAMP% %HOSTNAME% %syslogtag%%msg%\""; +static uchar template_ForwardFormat[] = "\"<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogtag:1:32%%msg%\""; +static uchar template_TraditionalForwardFormat[] = "\"<%PRI%>%TIMESTAMP% %HOSTNAME% %syslogtag:1:32%%msg%\""; static uchar template_StdUsrMsgFmt[] = "\" %syslogtag%%msg%\n\r\""; static uchar template_StdDBFmt[] = "\"insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%HOSTNAME%', %syslogpriority%, '%timereported:::date-mysql%', '%timegenerated:::date-mysql%', %iut%, '%syslogtag%')\",SQL"; static uchar template_StdPgSQLFmt[] = "\"insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%HOSTNAME%', %syslogpriority%, '%timereported:::date-pgsql%', '%timegenerated:::date-pgsql%', %iut%, '%syslogtag%')\",STDSQL"; @@ -1408,7 +1408,6 @@ static int parseLegacySyslogMsg(msg_t *pMsg, int flags) * machine that we received the message from and the tag will be empty. This * is meant to be an interim solution, but for now it is in the code. */ - if(bParseHOSTNAMEandTAG && !(flags & INTERNAL_MSG)) { /* parse HOSTNAME - but only if this is network-received! * rger, 2005-11-14: we still have a problem with BSD messages. These messages @@ -1466,16 +1465,18 @@ static int parseLegacySyslogMsg(msg_t *pMsg, int flags) MsgSetHOSTNAME(pMsg, getRcvFrom(pMsg)); } - /* now parse TAG - that should be present in message from - * all sources. + /* now parse TAG - that should be present in message from all sources. * This code is somewhat not compliant with RFC 3164. As of 3164, * the TAG field is ended by any non-alphanumeric character. In * practice, however, the TAG often contains dashes and other things, * which would end the TAG. So it is not desirable. As such, we only * accept colon and SP to be terminators. Even there is a slight difference: * a colon is PART of the TAG, while a SP is NOT part of the tag - * (it is CONTENT). Finally, we allow only up to 32 characters for - * TAG, as it is specified in RFC 3164. + * (it is CONTENT). Starting 2008-04-04, we have removed the 32 character + * size limit (from RFC3164) on the tag. This had bad effects on existing + * envrionments, as sysklogd didn't obey it either (probably another bug + * in RFC3164...). We now receive the full size, but will modify the + * outputs so that only 32 characters max are used by default. */ /* The following code in general is quick & dirty - I need to get * it going for a test, rgerhards 2004-11-16 */ @@ -1489,15 +1490,10 @@ static int parseLegacySyslogMsg(msg_t *pMsg, int flags) rsCStrSetAllocIncrement(pStrB, 33); pWork = pBuf; iCnt = 0; - while(*p2parse && *p2parse != ':' && *p2parse != ' ' && iCnt < 32) { + while(*p2parse && *p2parse != ':' && *p2parse != ' ') { rsCStrAppendChar(pStrB, *p2parse++); ++iCnt; } - if (iCnt == 32) { - while(*p2parse && *p2parse != ':' && *p2parse != ' ') { - ++p2parse; - } - } if(*p2parse == ':') { ++p2parse; rsCStrAppendChar(pStrB, ':'); -- cgit v1.2.3 From 10da14f1a80b83feaf048c7bfa608f680a6b11d4 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 4 Apr 2008 09:48:30 +0000 Subject: updating ... finally for release --- doc/status.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/status.html b/doc/status.html index bfced290..d7111a50 100644 --- a/doc/status.html +++ b/doc/status.html @@ -2,7 +2,7 @@ rsyslog status page

    rsyslog status page

    -

    This page reflects the status as of 2008-04-02.

    +

    This page reflects the status as of 2008-04-04.

    Current Releases

    development: 3.15.0 - @@ -30,7 +30,7 @@ help port rsyslog to other platforms. As such, platform list is now maintained inside the rsyslog wiki. Platform maintainers perhaps have posted extra information there. If you do platform-specific work, feel free to add information to the wiki.

    -

    Rsyslog is the default syslogd in Fedora 8.

    +

    Rsyslog is the default syslogd in Fedora 8 and above.

    Additional information

    Currently supported features are listed on the rsyslog features page.

      -- cgit v1.2.3 From cd9762ddae5e0350ede5431c88346690799a688e Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 4 Apr 2008 12:04:54 +0000 Subject: bugfix: zero-length strings were not supported in object deserializer --- ChangeLog | 2 ++ obj.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 92585e19..9320fcbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ Version 3.14.0 (rgerhards), 2008-04-04 - bugfix: rsyslogd was no longer build by default; man pages are only installed if corresponding option is selected. Thanks to Michael Biebl for pointing these problems out. +- bugfix: zero-length strings were not supported in object + deserializer - disabled atomic operations for this stable build as it caused platform problems - bugfix: memory leaks in script engine diff --git a/obj.c b/obj.c index d408c4bb..2f16669a 100644 --- a/obj.c +++ b/obj.c @@ -495,7 +495,7 @@ finalize_it: } -/* de-serialize a string, length must be provided */ +/* de-serialize a string, length must be provided but may be 0 */ static rsRetVal objDeserializeStr(cstr_t **ppCStr, int iLen, strm_t *pStrm) { DEFiRet; @@ -504,7 +504,7 @@ static rsRetVal objDeserializeStr(cstr_t **ppCStr, int iLen, strm_t *pStrm) cstr_t *pCStr = NULL; assert(ppCStr != NULL); - assert(iLen > 0); + assert(iLen >= 0); CHKiRet(rsCStrConstruct(&pCStr)); -- cgit v1.2.3 From 91e02eb209a6571429a00fa71854709dfc18ac99 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 4 Apr 2008 12:05:28 +0000 Subject: bugfix: zero-length strings were not supported in object deserializer --- ChangeLog | 2 ++ obj.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5926cc3f..7b18ef73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ Version 3.15.1 (rgerhards), 2008-04-?? - disabled atomic operations for the time being because they introduce some cross-platform trouble - need to see how to fix this in the best possible way +- bugfix: zero-length strings were not supported in object + deserializer - added librelp check via PKG_CHECK thanks to Michael Biebl's patch - file relputil.c deleted, is not actually needed - added more meaningful error messages to rsyslogd (when some errors diff --git a/obj.c b/obj.c index d408c4bb..2f16669a 100644 --- a/obj.c +++ b/obj.c @@ -495,7 +495,7 @@ finalize_it: } -/* de-serialize a string, length must be provided */ +/* de-serialize a string, length must be provided but may be 0 */ static rsRetVal objDeserializeStr(cstr_t **ppCStr, int iLen, strm_t *pStrm) { DEFiRet; @@ -504,7 +504,7 @@ static rsRetVal objDeserializeStr(cstr_t **ppCStr, int iLen, strm_t *pStrm) cstr_t *pCStr = NULL; assert(ppCStr != NULL); - assert(iLen > 0); + assert(iLen >= 0); CHKiRet(rsCStrConstruct(&pCStr)); -- cgit v1.2.3 From eb5339d4ab214e1b01a81d9f26e595148f60d939 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 4 Apr 2008 12:19:24 +0000 Subject: bugfix: some messages were emited without hostname --- ChangeLog | 1 + syslogd.c | 81 +++++++++++++++++++++++++++++++-------------------------------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9320fcbf..ac32eabe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ --------------------------------------------------------------------------- Version 3.14.0 (rgerhards), 2008-04-04 +- bugfix: some messages were emited without hostname - bugfix: rsyslogd was no longer build by default; man pages are only installed if corresponding option is selected. Thanks to Michael Biebl for pointing these problems out. diff --git a/syslogd.c b/syslogd.c index 99e0efcc..355689c0 100644 --- a/syslogd.c +++ b/syslogd.c @@ -2962,6 +2962,46 @@ int realMain(int argc, char **argv) int bImUxSockLoaded = 0; /* already generated a $ModLoad imuxsock? */ uchar legacyConfLine[80]; + gethostname(LocalHostName, sizeof(LocalHostName)); + if ( (p = strchr(LocalHostName, '.')) ) { + *p++ = '\0'; + LocalDomain = p; + } + else + { + LocalDomain = ""; + + /* It's not clearly defined whether gethostname() + * should return the simple hostname or the fqdn. A + * good piece of software should be aware of both and + * we want to distribute good software. Joey + * + * Good software also always checks its return values... + * If syslogd starts up before DNS is up & /etc/hosts + * doesn't have LocalHostName listed, gethostbyname will + * return NULL. + */ + /* TODO: gethostbyname() is not thread-safe, but replacing it is + * not urgent as we do not run on multiple threads here. rgerhards, 2007-09-25 + */ + hent = gethostbyname(LocalHostName); + if(hent) { + snprintf(LocalHostName, sizeof(LocalHostName), "%s", hent->h_name); + + if ( (p = strchr(LocalHostName, '.')) ) + { + *p++ = '\0'; + LocalDomain = p; + } + } + } + + /* Convert to lower case to recognize the correct domain laterly + */ + for (p = (char *)LocalDomain; *p ; p++) + if (isupper((int) *p)) + *p = (char)tolower((int)*p); + CHKiRet(InitGlobalClasses()); /* doing some core initializations */ @@ -3232,47 +3272,6 @@ int realMain(int argc, char **argv) } myPid = getpid(); /* save our pid for further testing (also used for messages) */ - - gethostname(LocalHostName, sizeof(LocalHostName)); - if ( (p = strchr(LocalHostName, '.')) ) { - *p++ = '\0'; - LocalDomain = p; - } - else - { - LocalDomain = ""; - - /* It's not clearly defined whether gethostname() - * should return the simple hostname or the fqdn. A - * good piece of software should be aware of both and - * we want to distribute good software. Joey - * - * Good software also always checks its return values... - * If syslogd starts up before DNS is up & /etc/hosts - * doesn't have LocalHostName listed, gethostbyname will - * return NULL. - */ - /* TODO: gethostbyname() is not thread-safe, but replacing it is - * not urgent as we do not run on multiple threads here. rgerhards, 2007-09-25 - */ - hent = gethostbyname(LocalHostName); - if(hent) { - snprintf(LocalHostName, sizeof(LocalHostName), "%s", hent->h_name); - - if ( (p = strchr(LocalHostName, '.')) ) - { - *p++ = '\0'; - LocalDomain = p; - } - } - } - - /* Convert to lower case to recognize the correct domain laterly - */ - for (p = (char *)LocalDomain; *p ; p++) - if (isupper((int) *p)) - *p = (char)tolower((int)*p); - memset(&sigAct, 0, sizeof (sigAct)); sigemptyset(&sigAct.sa_mask); -- cgit v1.2.3 From bd5433196fb49972977b981baa25194e609e160d Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 4 Apr 2008 12:26:19 +0000 Subject: bugfix: some messages were emited without hostname --- ChangeLog | 1 + queue.c | 2 -- syslogd.c | 81 +++++++++++++++++++++++++++++++-------------------------------- 3 files changed, 41 insertions(+), 43 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7b18ef73..187a0538 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ --------------------------------------------------------------------------- Version 3.15.1 (rgerhards), 2008-04-?? +- bugfix: some messages were emited without hostname - disabled atomic operations for the time being because they introduce some cross-platform trouble - need to see how to fix this in the best possible way diff --git a/queue.c b/queue.c index 7ae5815d..ed720c55 100644 --- a/queue.c +++ b/queue.c @@ -2208,8 +2208,6 @@ rsRetVal queueQueryInterface(void) { return RS_RET_NOT_IMPLEMENTED; } */ BEGINObjClassInit(queue, 1, OBJ_IS_CORE_MODULE) /* request objects we use */ -DEFpropSetMeth(queue, iDeqtWinFromHr, int); -DEFpropSetMeth(queue, iDeqtWinToHr, int); /* now set our own handlers */ OBJSetMethodHandler(objMethod_SETPROPERTY, queueSetProperty); diff --git a/syslogd.c b/syslogd.c index 99020a5f..1c6766dc 100644 --- a/syslogd.c +++ b/syslogd.c @@ -2992,6 +2992,46 @@ int realMain(int argc, char **argv) int bImUxSockLoaded = 0; /* already generated a $ModLoad imuxsock? */ uchar legacyConfLine[80]; + gethostname(LocalHostName, sizeof(LocalHostName)); + if ( (p = strchr(LocalHostName, '.')) ) { + *p++ = '\0'; + LocalDomain = p; + } + else + { + LocalDomain = ""; + + /* It's not clearly defined whether gethostname() + * should return the simple hostname or the fqdn. A + * good piece of software should be aware of both and + * we want to distribute good software. Joey + * + * Good software also always checks its return values... + * If syslogd starts up before DNS is up & /etc/hosts + * doesn't have LocalHostName listed, gethostbyname will + * return NULL. + */ + /* TODO: gethostbyname() is not thread-safe, but replacing it is + * not urgent as we do not run on multiple threads here. rgerhards, 2007-09-25 + */ + hent = gethostbyname(LocalHostName); + if(hent) { + snprintf(LocalHostName, sizeof(LocalHostName), "%s", hent->h_name); + + if ( (p = strchr(LocalHostName, '.')) ) + { + *p++ = '\0'; + LocalDomain = p; + } + } + } + + /* Convert to lower case to recognize the correct domain laterly + */ + for (p = (char *)LocalDomain; *p ; p++) + if (isupper((int) *p)) + *p = (char)tolower((int)*p); + CHKiRet_Hdlr(InitGlobalClasses()) { fprintf(stderr, "rsyslogd initializiation failed - global classes could not be initialized.\n" @@ -3269,47 +3309,6 @@ int realMain(int argc, char **argv) } myPid = getpid(); /* save our pid for further testing (also used for messages) */ - - gethostname(LocalHostName, sizeof(LocalHostName)); - if ( (p = strchr(LocalHostName, '.')) ) { - *p++ = '\0'; - LocalDomain = p; - } - else - { - LocalDomain = ""; - - /* It's not clearly defined whether gethostname() - * should return the simple hostname or the fqdn. A - * good piece of software should be aware of both and - * we want to distribute good software. Joey - * - * Good software also always checks its return values... - * If syslogd starts up before DNS is up & /etc/hosts - * doesn't have LocalHostName listed, gethostbyname will - * return NULL. - */ - /* TODO: gethostbyname() is not thread-safe, but replacing it is - * not urgent as we do not run on multiple threads here. rgerhards, 2007-09-25 - */ - hent = gethostbyname(LocalHostName); - if(hent) { - snprintf(LocalHostName, sizeof(LocalHostName), "%s", hent->h_name); - - if ( (p = strchr(LocalHostName, '.')) ) - { - *p++ = '\0'; - LocalDomain = p; - } - } - } - - /* Convert to lower case to recognize the correct domain laterly - */ - for (p = (char *)LocalDomain; *p ; p++) - if (isupper((int) *p)) - *p = (char)tolower((int)*p); - memset(&sigAct, 0, sizeof (sigAct)); sigemptyset(&sigAct.sa_mask); -- cgit v1.2.3 From c7173e592773e73ebf3e005402ffdb347b555d5f Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 4 Apr 2008 15:30:53 +0000 Subject: preparing for 3.14.1 release --- ChangeLog | 7 ++++++- configure.ac | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ac32eabe..09fca562 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,5 @@ --------------------------------------------------------------------------- -Version 3.14.0 (rgerhards), 2008-04-04 +Version 3.14.1 (rgerhards), 2008-04-04 - bugfix: some messages were emited without hostname - bugfix: rsyslogd was no longer build by default; man pages are only installed if corresponding option is selected. Thanks to @@ -19,6 +19,11 @@ Version 3.14.0 (rgerhards), 2008-04-04 max are used by default. If you need large tags in the output, you need to provide custom templates. --------------------------------------------------------------------------- +Version 3.14.0 (rgerhards), 2008-04-02 +An interim version was accidently released to the web. It was named 3.14.0. +To avoid confusion, we have not assigned this version number to any +official release. If you happen to use 3.14.0, please update to 3.14.1. +--------------------------------------------------------------------------- Version 3.13.0-dev0 (rgerhards), 2008-03-31 - bugfix: accidently set debug option in 3.12.5 reset to production This option prevented dlclose() to be called. It had no real bad effects, diff --git a/configure.ac b/configure.ac index 7012018d..ae388a9a 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([rsyslog],[3.14.0],[rsyslog@lists.adiscon.com]) +AC_INIT([rsyslog],[3.14.1],[rsyslog@lists.adiscon.com]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([syslogd.c]) AC_CONFIG_HEADERS([config.h]) -- cgit v1.2.3 From 26000d7bf153606fcfe6f1665ff7b441348a20f1 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 4 Apr 2008 17:04:54 +0000 Subject: bugfix: segfault with expression-based filters - so far untested --- ChangeLog | 3 +++ syslogd.c | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 09fca562..228f9230 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,7 @@ --------------------------------------------------------------------------- +Version 3.14.2 (rgerhards), 2008-04-?? +- bugfix: segfault with expression-based filters +--------------------------------------------------------------------------- Version 3.14.1 (rgerhards), 2008-04-04 - bugfix: some messages were emited without hostname - bugfix: rsyslogd was no longer build by default; man pages are diff --git a/syslogd.c b/syslogd.c index 355689c0..f21fce7e 100644 --- a/syslogd.c +++ b/syslogd.c @@ -1053,10 +1053,11 @@ static rsRetVal shouldProcessThisMessage(selector_t *f, msg_t *pMsg, int *bProce finalize_it: /* destruct in any case, not just on error, but it makes error handling much easier */ - if(pVM != NULL) { - var.Destruct(&pResult); + if(pVM != NULL) vm.Destruct(&pVM); - } + + if(pResult != NULL) + var.Destruct(&pResult); *bProcessMsg = bRet; RETiRet; -- cgit v1.2.3 From 0c2298f0a163b72abc8c34eecffc4f1ea693bbb5 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 4 Apr 2008 17:05:25 +0000 Subject: bumped version number --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ae388a9a..e2bda201 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([rsyslog],[3.14.1],[rsyslog@lists.adiscon.com]) +AC_INIT([rsyslog],[3.14.2],[rsyslog@lists.adiscon.com]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([syslogd.c]) AC_CONFIG_HEADERS([config.h]) -- cgit v1.2.3 From c34ef852ee583de6e335f02d78f917b7d4da8062 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 4 Apr 2008 17:07:44 +0000 Subject: bugfix: segfault with expression-based filters - so far untested --- syslogd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/syslogd.c b/syslogd.c index 1c6766dc..9d4c778e 100644 --- a/syslogd.c +++ b/syslogd.c @@ -1053,10 +1053,11 @@ static rsRetVal shouldProcessThisMessage(selector_t *f, msg_t *pMsg, int *bProce finalize_it: /* destruct in any case, not just on error, but it makes error handling much easier */ - if(pVM != NULL) { - var.Destruct(&pResult); + if(pVM != NULL) vm.Destruct(&pVM); - } + + if(pResult != NULL) + var.Destruct(&pResult); *bProcessMsg = bRet; RETiRet; -- cgit v1.2.3 From 65f24e82a0a6777136fe894cd236b41e05e72765 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 7 Apr 2008 11:23:06 +0200 Subject: fixed file permissions --- liblogging-stub.h | 0 srUtils.c | 0 srUtils.h | 0 stringbuf.c | 0 stringbuf.h | 0 5 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 liblogging-stub.h mode change 100755 => 100644 srUtils.c mode change 100755 => 100644 srUtils.h mode change 100755 => 100644 stringbuf.c mode change 100755 => 100644 stringbuf.h diff --git a/liblogging-stub.h b/liblogging-stub.h old mode 100755 new mode 100644 diff --git a/srUtils.c b/srUtils.c old mode 100755 new mode 100644 diff --git a/srUtils.h b/srUtils.h old mode 100755 new mode 100644 diff --git a/stringbuf.c b/stringbuf.c old mode 100755 new mode 100644 diff --git a/stringbuf.h b/stringbuf.h old mode 100755 new mode 100644 -- cgit v1.2.3 From 833f4642621699890d05c041d3ace5de24f369ba Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 7 Apr 2008 12:14:49 +0200 Subject: fixed segfault when using expression based-filters This was introduced by an invalid CVS patch. --- syslogd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syslogd.c b/syslogd.c index f21fce7e..97d700f6 100644 --- a/syslogd.c +++ b/syslogd.c @@ -1056,6 +1056,7 @@ finalize_it: if(pVM != NULL) vm.Destruct(&pVM); +RUNLOG_VAR("%p", var); if(pResult != NULL) var.Destruct(&pResult); @@ -2838,12 +2839,11 @@ InitGlobalClasses(void) /* the following classes were intialized by objClassInit() */ CHKiRet(objUse(errmsg, CORE_COMPONENT)); CHKiRet(objUse(module, CORE_COMPONENT)); + CHKiRet(objUse(var, CORE_COMPONENT)); /* initialize and use classes. We must be very careful with the order of events. Some * classes use others and if we do not initialize them in the right order, we may end * up with an invalid call. The most important thing that can happen is that an error - pErrObj = "var"; - CHKiRet(objUse(var, CORE_COMPONENT)); * is detected and needs to be logged, wich in turn requires a broader number of classes * to be available. The solution is that we take care in the order of calls AND use a * class immediately after it is initialized. And, of course, we load those classes -- cgit v1.2.3 From 2f282692b572f25395aef6cfb6d656105c564a5e Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 7 Apr 2008 12:36:18 +0200 Subject: cleanup; var object was not dereferenced on termination --- syslogd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/syslogd.c b/syslogd.c index 97d700f6..4d9f8257 100644 --- a/syslogd.c +++ b/syslogd.c @@ -1056,7 +1056,6 @@ finalize_it: if(pVM != NULL) vm.Destruct(&pVM); -RUNLOG_VAR("%p", var); if(pResult != NULL) var.Destruct(&pResult); @@ -2900,6 +2899,7 @@ GlobalClassExit(void) objRelease(conf, CORE_COMPONENT); objRelease(expr, CORE_COMPONENT); objRelease(vm, CORE_COMPONENT); + objRelease(var, CORE_COMPONENT); objRelease(datetime, CORE_COMPONENT); /* TODO: implement the rest of the deinit */ @@ -2925,10 +2925,7 @@ GlobalClassExit(void) CHKiRet(templateInit()); #endif /* dummy "classes */ -dbgprintf("pre strExit()\n"); strExit(); -dbgprintf("post strExit()\n"); - #if 0 CHKiRet(objGetObjInterface(&obj)); /* this provides the root pointer for all other queries */ -- cgit v1.2.3 From 2f8fb81bd4cfcc69049b767139389af023d1eef6 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 7 Apr 2008 12:37:32 +0200 Subject: cleanup --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 228f9230..8ea0dbed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ --------------------------------------------------------------------------- Version 3.14.2 (rgerhards), 2008-04-?? - bugfix: segfault with expression-based filters +- some cleanup --------------------------------------------------------------------------- Version 3.14.1 (rgerhards), 2008-04-04 - bugfix: some messages were emited without hostname -- cgit v1.2.3 From ade79c4df054e56905694013f2e60ad0bb3c8647 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 7 Apr 2008 12:59:28 +0200 Subject: some cleanup of debug messages --- expr.c | 3 --- vm.c | 7 ------- 2 files changed, 10 deletions(-) diff --git a/expr.c b/expr.c index e6f4ef23..5c11b756 100644 --- a/expr.c +++ b/expr.c @@ -371,7 +371,6 @@ exprParse(expr_t *pThis, ctok_t *tok) /* happy parsing... */ CHKiRet(expr(pThis, tok)); dbgoprint((obj_t*) pThis, "successfully parsed/created expression\n"); -vmprg.DebugPrint(pThis->pVmprg); finalize_it: RETiRet; @@ -392,8 +391,6 @@ CODESTARTobjQueryInterface(expr) * work here (if we can support an older interface version - that, * of course, also affects the "if" above). */ - //xxxpIf->oID = OBJexpr; - pIf->Construct = exprConstruct; pIf->ConstructFinalize = exprConstructFinalize; pIf->Destruct = exprDestruct; diff --git a/vm.c b/vm.c index a26e4331..b97898c5 100644 --- a/vm.c +++ b/vm.c @@ -193,8 +193,6 @@ CODESTARTop(CMP_CONTAINS) /* operand2 is on top of stack, so needs to be popped first */ vmstk.PopString(pThis->pStk, &operand2); vmstk.PopString(pThis->pStk, &operand1); -var.DebugPrint(operand1); \ -var.DebugPrint(operand2); \ /* TODO: extend cstr class so that it supports location of cstr inside cstr */ bRes = (rsCStrLocateInSzStr(operand2->val.pStr, rsCStrGetSzStr(operand1->val.pStr)) == -1) ? 0 : 1; @@ -233,8 +231,6 @@ CODESTARTop(CMP_STARTSWITH) /* operand2 is on top of stack, so needs to be popped first */ vmstk.PopString(pThis->pStk, &operand2); vmstk.PopString(pThis->pStk, &operand1); -var.DebugPrint(operand1); \ -var.DebugPrint(operand2); \ /* TODO: extend cstr class so that it supports location of cstr inside cstr */ bRes = (rsCStrStartsWithSzStr(operand1->val.pStr, rsCStrGetSzStr(operand2->val.pStr), rsCStrLen(operand2->val.pStr)) == 0) ? 1 : 0; @@ -254,14 +250,11 @@ CODESTARTop(CMP_STARTSWITHI) /* operand2 is on top of stack, so needs to be popped first */ vmstk.PopString(pThis->pStk, &operand2); vmstk.PopString(pThis->pStk, &operand1); -var.DebugPrint(operand1); \ -var.DebugPrint(operand2); \ /* TODO: extend cstr class so that it supports location of cstr inside cstr */ bRes = (rsCStrCaseInsensitveStartsWithSzStr(operand1->val.pStr, rsCStrGetSzStr(operand2->val.pStr), rsCStrLen(operand2->val.pStr)) == 0) ? 1 : 0; /* we have a result, so let's push it */ -RUNLOG_VAR("%lld", bRes); \ PUSHRESULTop(operand1, bRes); var.Destruct(&operand2); /* no longer needed */ ENDop(CMP_STARTSWITHI) -- cgit v1.2.3