EzDevInfo.com

rsyslog interview questions

Top rsyslog frequently asked interview questions

Increase precision of apache log to include milliseconds

I have modified the configuration of rsyslogd to disable RSYSLOG_TraditionalFileFormat. But still the apache log /var/log/apache/error.log is displaying only second-precission.

Is there something else that needs to be configured?


Source: (StackOverflow)

Send Output errors of nohup to syslog

I'm attempting to write a bash script that uses nohup and passes errors to rsyslog.

I've tried this command with different variations of the log variable (see below) but can't get the output passed to anything but a std txt file. I can't get it to pipe.

nohup imageprocessor.sh > "$LOG" &

Is it possible to pipe nohup output or do I need a different command.

A couple of variations of log that I have tried

LOG="|/usr/bin/logger -t workspaceworker -p LOCAL5.info &2"

or

LOG="|logtosyslog.sh"

or

LOG="logtosyslog.sh"

Source: (StackOverflow)

Advertisements

Why can't rsyslogd find libgcc_s.so.1?

Scenario: Running a debootstrapped Ubuntu 11.4 lxc guest on a Ubuntu 12.4 lxc host (both 64 bit)

Inside the lxc guest, rsyslogd is constantly crashing with SIGABRT stating:

libgcc_s.so.1 must be installed for pthread_cancel to work
0334.380551272:7f4128a84700: 
Signal 6 (SIGABRT) occured, execution must be terminated.

I'm not sure why libgcc_s.so.1 cannot be found. If I run ldconfig -p:

$# ldconfig -p | grep libgcc
        libgcc_s.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libgcc_s.so.1
        libgcc_s.so.1 (libc6) => /usr/lib32/libgcc_s.so.1

It is listed. And both of those links are valid.

How do I resolve this problem?

EDIT: objdump -T output by request:

/lib/x86_64-linux-gnu/libgcc_s.so.1:     file format elf64-x86-64

DYNAMIC SYMBOL TABLE:
00000000000025d8 l    d  .init  0000000000000000              .init
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 memset
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 abort
0000000000000000  w   D  *UND*  0000000000000000              __gmon_start__
0000000000000000  w   D  *UND*  0000000000000000              _Jv_RegisterClasses
0000000000000000  w   D  *UND*  0000000000000000              pthread_key_create
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 malloc
0000000000000000  w   D  *UND*  0000000000000000              pthread_once
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 free
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 strlen
0000000000000000  w   D  *UND*  0000000000000000              pthread_getspecific
0000000000000000  w   DF *UND*  0000000000000000  GLIBC_2.2.5 __cxa_finalize
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 memcpy
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 dl_iterate_phdr
0000000000000000  w   D  *UND*  0000000000000000              pthread_cancel
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 calloc
0000000000000000  w   DF *UND*  0000000000000000  GLIBC_2.2.5 pthread_mutex_lock
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 realloc
0000000000000000  w   DF *UND*  0000000000000000  GLIBC_2.2.5 pthread_mutex_unlock
0000000000000000  w   D  *UND*  0000000000000000              pthread_setspecific
0000000000002de0 g    DF .text  0000000000000028  GCC_3.0     __mulvsi3
000000000000a8c0 g    DF .text  000000000000034c  GCC_4.3.0   __floatuntitf
000000000000c160 g    DF .text  00000000000001cf  GCC_4.3.0   __letf2
00000000000050a0 g    DF .text  0000000000000223  GCC_3.0     __modti3
0000000000009530 g    DF .text  0000000000000094  GCC_4.3.0   __unordtf2
0000000000004660 g    DF .text  0000000000000007  GCC_4.3.0   __bswapdi2
0000000000004ea0 g    DF .text  0000000000000045  GCC_4.2.0   __floatuntixf
0000000000011d80 g    DF .text  000000000000017f  GCC_4.3.0   __emutls_get_address
0000000000000000 g    DO *ABS*  0000000000000000  GCC_3.0     GCC_3.0
0000000000006ac0 g    DF .text  0000000000000a0f  GCC_4.3.0   __divtf3
0000000000002b70 g    DF .text  0000000000000032  GCC_3.0     __ucmpti2
0000000000000000 g    DO *ABS*  0000000000000000  GCC_3.3     GCC_3.3
0000000000000000 g    DO *ABS*  0000000000000000  GCC_3.4     GCC_3.4
0000000000002ac0 g    DF .text  0000000000000062  GCC_3.0     __ashrti3
0000000000002c60 g    DF .text  000000000000002d  GCC_3.0     __addvdi3
0000000000003270 g    DF .text  0000000000000036  GCC_3.4     __paritydi2
0000000000002cc0 g    DF .text  0000000000000042  GCC_3.4.4   __addvti3
00000000000032b0 g    DF .text  0000000000000039  GCC_3.4     __parityti2
00000000000098b0 g    DF .text  00000000000000ee  GCC_4.3.0   __floatsitf
0000000000002a60 g    DF .text  000000000000005f  GCC_3.0     __ashlti3
000000000000f830 g    DF .text  00000000000000e5  GCC_3.0     _Unwind_Resume
000000000000fa40 g    DF .text  00000000000000ab  GCC_3.3     _Unwind_Backtrace
0000000000000000 g    DO *ABS*  0000000000000000  GCC_3.4.2   GCC_3.4.2
00000000000036a0 g    DF .text  00000000000002e7  GCC_4.0.0   __muldc3
000000000000cb30 g    DF .text  0000000000000630  GCC_4.3.0   __multc3
000000000000cb30 g    DF .text  0000000000000630 (GCC_4.0.0)  __multc3
0000000000000000 g    DO *ABS*  0000000000000000  GCC_3.4.4   GCC_3.4.4
00000000000029d0 g    DF .text  0000000000000026  GCC_3.0     __negti2
000000000000c330 g    DF .text  0000000000000132  GCC_4.3.0   __eqtf2
0000000000003340 g    DF .text  000000000000004d  GCC_4.0.0   __powidf2
000000000000d160 g    DF .text  00000000000000a7  GCC_4.3.0   __powitf2
0000000000003180 g    DF .text  0000000000000009  GCC_3.4     __clzdi2
000000000000d160 g    DF .text  00000000000000a7 (GCC_4.0.0)  __powitf2
0000000000003190 g    DF .text  0000000000000022  GCC_3.4     __clzti2
00000000000052d0 g    DF .text  0000000000000113  GCC_3.0     __udivti3
0000000000009e00 g    DF .text  00000000000000fe  GCC_4.3.0   __floatditf
000000000000b540 g    DF .text  000000000000052f  GCC_4.3.0   __trunctfdf2
0000000000004b10 g    DF .text  00000000000000ca  GCC_3.0     __floattisf
0000000000009c80 g    DF .text  0000000000000173  GCC_4.3.0   __fixunstfdi
000000000000ac10 g    DF .text  0000000000000172  GCC_4.3.0   __extendsftf2
000000000000d6a0 g    DF .text  0000000000000008  GCC_3.0     _Unwind_GetLanguageSpecificData
000000000000d6c0 g    DF .text  0000000000000023  GCC_3.3     _Unwind_FindEnclosingFunction
000000000000d670 g    DF .text  0000000000000015  GCC_4.2.0   _Unwind_GetIPInfo
000000000000a2a0 g    DF .text  000000000000024a  GCC_4.3.0   __fixunstfti
00000000000112c0 g    DF .text  0000000000000132  GCC_3.0     __deregister_frame_info_bases
0000000000003150 g    DF .text  0000000000000010  GCC_3.0     __ffsdi2
0000000000003160 g    DF .text  000000000000001e  GCC_3.0     __ffsti2
00000000000047c0 g    DF .text  0000000000000039  GCC_3.0     __fixxfti
000000000000d6f0 g    DF .text  0000000000000008  GCC_3.0     _Unwind_GetDataRelBase
0000000000004070 g    DF .text  00000000000002ef  GCC_4.0.0   __divdc3
000000000000c470 g    DF .text  00000000000006b1  GCC_4.3.0   __divtc3
000000000000c470 g    DF .text  00000000000006b1 (GCC_4.0.0)  __divtc3
0000000000000000 g    DO *ABS*  0000000000000000  GCC_4.2.0   GCC_4.2.0
0000000000002dc0 g    DF .text  0000000000000020  GCC_3.0     __mulvdi3
0000000000002c00 g    DF .text  000000000000001b  GCC_3.0     __absvsi2
0000000000002e10 g    DF .text  000000000000028c  GCC_3.4.4   __mulvti3
00000000000112a0 g    DF .text  000000000000001a  GCC_3.0     __register_frame_table
0000000000008170 g    DF .text  00000000000013ba  GCC_4.3.0   __subtf3
000000000000af30 g    DF .text  000000000000016b  GCC_4.3.0   __extendxftf2
0000000000003990 g    DF .text  0000000000000413  GCC_4.0.0   __mulxc3
0000000000007e30 g    DF .text  000000000000033e  GCC_4.3.0   __negtf2
0000000000011210 g    DF .text  0000000000000072  GCC_3.0     __register_frame_info_table_bases
0000000000003390 g    DF .text  000000000000005f  GCC_4.0.0   __powixf2
0000000000004be0 g    DF .text  00000000000000ca  GCC_3.0     __floattidf
000000000000d6b0 g    DF .text  0000000000000008  GCC_3.0     _Unwind_GetRegionStart
000000000000a4f0 g    DF .text  00000000000003c1  GCC_4.3.0   __floattitf
0000000000004cb0 g    DF .text  000000000000002d  GCC_3.0     __floattixf
000000000000ba70 g    DF .text  0000000000000503  GCC_4.3.0   __trunctfxf2
0000000000011440 g    DF .text  00000000000001fd  GCC_3.0     _Unwind_Find_FDE
000000000000d690 g    DF .text  0000000000000008  GCC_3.0     _Unwind_SetIP
00000000000053f0 g    DF .text  000000000000018e  GCC_3.0     __umodti3
000000000000d660 g    DF .text  0000000000000008  GCC_3.0     _Unwind_GetIP
00000000000046d0 g    DF .text  000000000000006b  GCC_3.0     __fixunsxfdi
0000000000011130 g    DF .text  000000000000009a  GCC_3.0     __register_frame_info_bases
0000000000004940 g    DF .text  00000000000001ce  GCC_3.0     __fixunsxfti
0000000000004360 g    DF .text  00000000000002e6  GCC_4.0.0   __divxc3
0000000000002d40 g    DF .text  000000000000002c  GCC_3.0     __subvsi3
0000000000004740 g    DF .text  0000000000000037  GCC_3.0     __fixsfti
00000000000057c0 g    DF .text  00000000000012f7  GCC_4.3.0   __addtf3
0000000000000000 g    DO *ABS*  0000000000000000  GCC_4.3.0   GCC_4.3.0
00000000000030d0 g    DF .text  0000000000000024  GCC_3.0     __negvsi2
0000000000002bd0 g    DF .text  0000000000000025  GCC_3.0     __absvdi2
0000000000002980 g    DF .text  000000000000004c  GCC_3.0     __multi3
000000000000fa20 g    DF .text  000000000000001a  GCC_3.0     _Unwind_DeleteException
0000000000002c20 g    DF .text  0000000000000034  GCC_3.4.4   __absvti2
000000000000d600 g    DF .text  0000000000000008  GCC_3.3     _Unwind_GetCFA
0000000000002a00 g    DF .text  000000000000005f  GCC_3.0     __lshrti3
0000000000002bc0 g    DF .text  0000000000000002  GCC_3.4.2   __enable_execute_stack
00000000000031f0 g    DF .text  000000000000002c  GCC_3.4     __popcountdi2
0000000000000000 g    DO *ABS*  0000000000000000  GCC_4.0.0   GCC_4.0.0
0000000000003220 g    DF .text  0000000000000045  GCC_3.4     __popcountti2
0000000000002bb0 g    DF .text  0000000000000002  GCC_3.0     __clear_cache
000000000000c330 g    DF .text  0000000000000132 (GCC_3.0)    __netf2
000000000000c330 g    DF .text  0000000000000132  GCC_4.3.0   __netf2
0000000000004780 g    DF .text  0000000000000040  GCC_3.0     __fixdfti
00000000000099a0 g    DF .text  00000000000000db  GCC_4.3.0   __floatunsitf
00000000000095d0 g    DF .text  0000000000000190  GCC_4.3.0   __fixtfsi
0000000000002b30 g    DF .text  0000000000000032  GCC_3.0     __cmpti2
000000000000ad90 g    DF .text  0000000000000195  GCC_4.3.0   __extenddftf2
0000000000004650 g    DF .text  0000000000000005  GCC_4.3.0   __bswapsi2
000000000000f5d0 g    DF .text  000000000000016c  GCC_3.0     _Unwind_RaiseException
0000000000009f00 g    DF .text  00000000000000d3  GCC_4.3.0   __floatunditf
0000000000002c90 g    DF .text  000000000000002c  GCC_3.0     __addvsi3
0000000000004ce0 g    DF .text  00000000000000d6  GCC_4.2.0   __floatuntisf
000000000000bf80 g    DF .text  00000000000001df (GCC_3.0)    __gttf2
000000000000bf80 g    DF .text  00000000000001df  GCC_4.3.0   __gttf2
0000000000011410 g    DF .text  0000000000000021  GCC_3.0     __deregister_frame
0000000000000000 g    DO *ABS*  0000000000000000  GCC_3.3.1   GCC_3.3.1
00000000000031c0 g    DF .text  0000000000000005  GCC_3.4     __ctzdi2
0000000000004ef0 g    DF .text  00000000000001ab  GCC_3.0     __divti3
00000000000033f0 g    DF .text  00000000000002a5  GCC_4.0.0   __mulsc3
00000000000031d0 g    DF .text  000000000000001b  GCC_3.4     __ctzti2
0000000000011290 g    DF .text  0000000000000009  GCC_3.0     __register_frame_info_table
00000000000111e0 g    DF .text  0000000000000026  GCC_3.0     __register_frame
00000000000032f0 g    DF .text  000000000000004b  GCC_4.0.0   __powisf2
000000000000bf80 g    DF .text  00000000000001df  GCC_4.3.0   __getf2
0000000000004670 g    DF .text  000000000000002c  GCC_3.0     __fixunssfdi
000000000000b0a0 g    DF .text  000000000000049b  GCC_4.3.0   __trunctfsf2
00000000000074d0 g    DF .text  000000000000095f  GCC_4.3.0   __multf3
000000000000f920 g    DF .text  00000000000000f9  GCC_3.3     _Unwind_Resume_or_Rethrow
0000000000011f00 g    DF .text  0000000000000035  GCC_4.3.0   __emutls_register_common
0000000000002d10 g    DF .text  000000000000002d  GCC_3.0     __subvdi3
0000000000004800 g    DF .text  000000000000009f  GCC_3.0     __fixunssfti
0000000000002d70 g    DF .text  0000000000000042  GCC_3.4.4   __subvti3
0000000000009a80 g    DF .text  00000000000001fc  GCC_4.3.0   __fixtfdi
00000000000111d0 g    DF .text  0000000000000009  GCC_3.0     __register_frame_info
00000000000030a0 g    DF .text  000000000000002a  GCC_3.0     __negvdi2
0000000000005590 g    DF .text  000000000000022a  GCC_3.0     __udivmodti4
000000000000c160 g    DF .text  00000000000001cf (GCC_3.0)    __lttf2
0000000000003100 g    DF .text  000000000000004e  GCC_3.4.4   __negvti2
000000000000c160 g    DF .text  00000000000001cf  GCC_4.3.0   __lttf2
00000000000046a0 g    DF .text  0000000000000030  GCC_3.0     __fixunsdfdi
0000000000009fe0 g    DF .text  00000000000002b6  GCC_4.3.0   __fixtfti
0000000000011400 g    DF .text  0000000000000005  GCC_3.0     __deregister_frame_info
0000000000009760 g    DF .text  000000000000014b  GCC_4.3.0   __fixunstfsi
0000000000011800 g    DF .text  000000000000045c  GCC_3.3.1   __gcc_personality_v0
00000000000048a0 g    DF .text  0000000000000097  GCC_3.0     __fixunsdfti
000000000000d610 g    DF .text  0000000000000050  GCC_3.0     _Unwind_SetGR
0000000000004dc0 g    DF .text  00000000000000d6  GCC_4.2.0   __floatuntidf
0000000000003db0 g    DF .text  00000000000002b8  GCC_4.0.0   __divsc3
000000000000d5b0 g    DF .text  0000000000000048  GCC_3.0     _Unwind_GetGR
000000000000d700 g    DF .text  0000000000000008  GCC_3.0     _Unwind_GetTextRelBase
000000000000f740 g    DF .text  00000000000000ef  GCC_3.0     _Unwind_ForcedUnwind



/usr/lib32/libgcc_s.so.1:     file format elf32-i386

DYNAMIC SYMBOL TABLE:
00000000      DF *UND*  00000000  GLIBC_2.0   abort
00000000  w   D  *UND*  00000000              __gmon_start__
00000000  w   D  *UND*  00000000              _Jv_RegisterClasses
00000000      DF *UND*  00000000  GLIBC_2.0   realloc
00000000      DF *UND*  00000000  GLIBC_2.0   calloc
00000000  w   D  *UND*  00000000              pthread_key_create
00000000      DF *UND*  00000000  GLIBC_2.0   memset
00000000  w   D  *UND*  00000000              pthread_once
00000000      DF *UND*  00000000  GLIBC_2.0   free
00000000  w   D  *UND*  00000000              pthread_getspecific
00000000  w   DF *UND*  00000000  GLIBC_2.0   pthread_mutex_unlock
00000000      DF *UND*  00000000  GLIBC_2.0   memcpy
00000000      DF *UND*  00000000  GLIBC_2.0   strlen
00000000      DF *UND*  00000000  GLIBC_2.0   malloc
00000000  w   DF *UND*  00000000  GLIBC_2.0   pthread_mutex_lock
00000000  w   D  *UND*  00000000              pthread_cancel
00000000      DF *UND*  00000000  GLIBC_2.2.4 dl_iterate_phdr
00000000  w   DF *UND*  00000000  GLIBC_2.1.3 __cxa_finalize
00000000  w   D  *UND*  00000000              pthread_setspecific
00007c10 g    DF .text  000001d0  GLIBC_2.0   __moddi3
00002450 g    DF .text  00000038  GCC_3.0     __mulvsi3
0000c120 g    DF .text  00000225  GCC_4.4.0   __letf2
000103e0 g    DF .text  00000096  GCC_4.4.0   __unordtf2
000074b0 g    DF .text  0000000f  GCC_4.3.0   __bswapdi2
000187b0 g    DF .text  000001a8  GCC_4.3.0   __emutls_get_address
00000000 g    DO *ABS*  00000000  GCC_3.0     GCC_3.0
00002200 g    DF .text  0000003d  GCC_3.0     __ucmpdi2
0000a810 g    DF .text  0000156b  GCC_4.4.0   __divtf3
00002160 g    DF .text  00000060  GCC_3.0     __ashrdi3
00015da0 g    DF .text  000000d9  GLIBC_2.0   __frame_state_for
00000000 g    DO *ABS*  00000000  GCC_3.3     GCC_3.3
00000000 g    DO *ABS*  00000000  GCC_3.4     GCC_3.4
00002330 g    DF .text  00000069  GCC_3.0     __addvdi3
000028d0 g    DF .text  0000002f  GCC_3.4     __paritydi2
00013490 g    DF .text  00000033  GCC_4.4.0   __fabstf2
000020f0 g    DF .text  00000061  GCC_3.0     __ashldi3
000109a0 g    DF .text  000001e8  GCC_4.4.0   __floatsitf
00016100 g    DF .text  000000e2  GCC_3.0     _Unwind_Resume
00016300 g    DF .text  00000089  GCC_3.3     _Unwind_Backtrace
00000000 g    DO *ABS*  00000000  GCC_3.4.2   GCC_3.4.2
00002fd0 g    DF .text  00000408  GCC_4.0.0   __muldc3
00002050 g    DF .text  00000031  GCC_3.0     __negdi2
000037e0 g    DF .text  000018a8  GCC_4.4.0   __multc3
0000bd80 g    DF .text  00000185  GCC_4.4.0   __eqtf2
00002960 g    DF .text  00000054  GCC_4.0.0   __powidf2
00007950 g    DF .text  0000002c  GCC_3.0     __floatdidf
00002790 g    DF .text  00000020  GCC_3.4     __clzdi2
00002a20 g    DF .text  000001ad  GCC_4.4.0   __powitf2
00007de0 g    DF .text  00000104  GLIBC_2.0   __udivdi3
000112f0 g    DF .text  00000210  GCC_4.4.0   __floatditf
00012720 g    DF .text  0000067b  GCC_4.4.0   __trunctfdf2
00007980 g    DF .text  0000002c  GCC_3.0     __floatdixf
00011050 g    DF .text  00000294  GCC_4.4.0   __fixunstfdi
000116f0 g    DF .text  0000039e  GCC_4.4.0   __extendsftf2
00013980 g    DF .text  0000000b  GCC_3.0     _Unwind_GetLanguageSpecificData
000139a0 g    DF .text  00000037  GCC_3.3     _Unwind_FindEnclosingFunction
00013950 g    DF .text  00000016  GCC_4.2.0   _Unwind_GetIPInfo
000076b0 g    DF .text  00000047  GCC_3.0     __fixxfdi
00017c20 g    DF .text  0000010f  GCC_3.0     __deregister_frame_info_bases
00002750 g    DF .text  0000002f  GCC_3.0     __ffsdi2
00000000 g    DO *ABS*  00000000  GCC_4.5.0   GCC_4.5.0
000139e0 g    DF .text  0000000b  GCC_3.0     _Unwind_GetDataRelBase
000075a0 g    DF .text  00000062  GCC_3.0     __fixunsxfsi
00005390 g    DF .text  000002f9  GCC_4.0.0   __divdc3
00005990 g    DF .text  00001b0f  GCC_4.4.0   __divtc3
00000000 g    DO *ABS*  00000000  GCC_4.2.0   GCC_4.2.0
00002490 g    DF .text  000001fe  GCC_3.0     __mulvdi3
00002260 g    DF .text  00000033  GCC_3.0     __absvsi2
00017be0 g    DF .text  00000033  GLIBC_2.0   __register_frame_table
0000dd70 g    DF .text  00002668  GCC_4.4.0   __subtf3
00011ea0 g    DF .text  00000293  GCC_4.5.0   __extendxftf2
000027f0 g    DF .text  00000050  GCC_3.4     __popcountsi2
000033e0 g    DF .text  000003f8  GCC_4.0.0   __mulxc3
0000d7c0 g    DF .text  000005a9  GCC_4.4.0   __negtf2
00017b00 g    DF .text  00000093  GCC_3.0     __register_frame_info_table_bases
000029c0 g    DF .text  00000054  GCC_4.0.0   __powixf2
00013990 g    DF .text  0000000b  GCC_3.0     _Unwind_GetRegionStart
00012da0 g    DF .text  000006ab  GCC_4.4.0   __trunctfxf2
00017da0 g    DF .text  000001de  GCC_3.0     _Unwind_Find_FDE
00013970 g    DF .text  0000000e  GCC_3.0     _Unwind_SetIP
00007ef0 g    DF .text  00000145  GLIBC_2.0   __umoddi3
00013940 g    DF .text  0000000b  GCC_3.0     _Unwind_GetIP
000027b0 g    DF .text  00000009  GCC_3.4     __ctzsi2
000077e0 g    DF .text  000000e0  GCC_3.0     __fixunsxfdi
00013450 g    DF .text  0000003e  GCC_4.4.0   __copysigntf3
000179c0 g    DF .text  000000a7  GCC_3.0     __register_frame_info_bases
000079b0 g    DF .text  00000059  GCC_4.2.0   __floatundisf
00005690 g    DF .text  000002fb  GCC_4.0.0   __divxc3
00007610 g    DF .text  00000047  GCC_3.0     __fixsfdi
000023a0 g    DF .text  0000003c  GCC_3.0     __subvsi3
00008230 g    DF .text  000025da  GCC_4.4.0   __addtf3
00000000 g    DO *ABS*  00000000  GCC_4.3.0   GCC_4.3.0
00002010 g    DF .text  00000035  GCC_3.0     __muldi3
00002690 g    DF .text  00000036  GCC_3.0     __negvsi2
000022a0 g    DF .text  00000050  GCC_3.0     __absvdi2
000162e0 g    DF .text  0000001f  GCC_3.0     _Unwind_DeleteException
000074c0 g    DF .text  00000062  GCC_3.0     __fixunssfsi
00002090 g    DF .text  0000005f  GCC_3.0     __lshrdi3
000138c0 g    DF .text  0000000b  GCC_3.3     _Unwind_GetCFA
00007660 g    DF .text  00000047  GCC_3.0     __fixdfdi
00002250 g    DF .text  00000005  GCC_3.4.2   __enable_execute_stack
00002840 g    DF .text  0000005b  GCC_3.4     __popcountdi2
00000000 g    DO *ABS*  00000000  GCC_4.0.0   GCC_4.0.0
00002240 g    DF .text  00000005  GCC_3.0     __clear_cache
0000bd80 g    DF .text  00000185  GCC_4.4.0   __netf2
00010b90 g    DF .text  000001a7  GCC_4.4.0   __floatunsitf
00010480 g    DF .text  000002b2  GCC_4.4.0   __fixtfsi
000021c0 g    DF .text  0000003d  GCC_3.0     __cmpdi2
00011a90 g    DF .text  00000401  GCC_4.4.0   __extenddftf2
00007530 g    DF .text  00000062  GCC_3.0     __fixunsdfsi
000074a0 g    DF .text  0000000a  GCC_4.3.0   __bswapsi2
00007a10 g    DF .text  00000037  GCC_4.2.0   __floatundidf
00015e90 g    DF .text  0000018e  GCC_3.0     _Unwind_RaiseException
00011500 g    DF .text  000001e7  GCC_4.4.0   __floatunditf
000022f0 g    DF .text  0000003c  GCC_3.0     __addvsi3
000028a0 g    DF .text  0000002a  GCC_3.4     __paritysi2
00007a50 g    DF .text  00000037  GCC_4.2.0   __floatundixf
0000bf10 g    DF .text  00000206  GCC_4.4.0   __gttf2
00017d60 g    DF .text  00000031  GLIBC_2.0   __deregister_frame
00000000 g    DO *ABS*  00000000  GCC_3.3.1   GCC_3.3.1
00007a90 g    DF .text  00000177  GLIBC_2.0   __divdi3
000027c0 g    DF .text  00000025  GCC_3.4     __ctzdi2
00002bd0 g    DF .text  000003f0  GCC_4.0.0   __mulsc3
00017ba0 g    DF .text  0000003a  GLIBC_2.0   __register_frame_info_table
00017ab0 g    DF .text  00000042  GLIBC_2.0   __register_frame
00002900 g    DF .text  00000054  GCC_4.0.0   __powisf2
00002780 g    DF .text  0000000c  GCC_3.4     __clzsi2
0000bf10 g    DF .text  00000206  GCC_4.4.0   __getf2
00007700 g    DF .text  0000006c  GCC_3.0     __fixunssfdi
00012140 g    DF .text  000005d4  GCC_4.4.0   __trunctfsf2
0000c350 g    DF .text  0000146a  GCC_4.4.0   __multf3
000161f0 g    DF .text  000000e2  GCC_3.3     _Unwind_Resume_or_Rethrow
00018960 g    DF .text  00000033  GCC_4.3.0   __emutls_register_common
000023e0 g    DF .text  00000069  GCC_3.0     __subvdi3
00000000 g    DO *ABS*  00000000  GLIBC_2.0   GLIBC_2.0
00010d40 g    DF .text  0000030d  GCC_4.4.0   __fixtfdi
00017a70 g    DF .text  0000003a  GLIBC_2.0   __register_frame_info
00002730 g    DF .text  00000014  GCC_4.3.0   __ffssi2
00008050 g    DF .text  000001d8  GCC_3.0     __udivmoddi4
000078c0 g    DF .text  0000008f  GCC_3.0     __floatdisf
000026d0 g    DF .text  0000005a  GCC_3.0     __negvdi2
00000000 g    DO *ABS*  00000000  GCC_4.4.0   GCC_4.4.0
0000c120 g    DF .text  00000225  GCC_4.4.0   __lttf2
00007770 g    DF .text  0000006c  GCC_3.0     __fixunsdfdi
00017d30 g    DF .text  00000023  GLIBC_2.0   __deregister_frame_info
00010740 g    DF .text  0000025a  GCC_4.4.0   __fixunstfsi
000181d0 g    DF .text  00000463  GCC_3.3.1   __gcc_personality_v0
000138d0 g    DF .text  0000006d  GCC_3.0     _Unwind_SetGR
00005090 g    DF .text  000002f1  GCC_4.0.0   __divsc3
00013850 g    DF .text  00000065  GCC_3.0     _Unwind_GetGR
000139f0 g    DF .text  0000000b  GCC_3.0     _Unwind_GetTextRelBase
00016020 g    DF .text  000000d8  GCC_3.0     _Unwind_ForcedUnwind

Source: (StackOverflow)

Using rsyslogd in Rails 3.0

I am running a couple of Rails 3.0 sites on a Debian server. Currently all logs go into RAILS_ROOT/log/production.log (RAILS_ROOT for each site)

I would like to change this, so that all logging goes through rsyslog and is placed in:

/var/log/rails/site1.log
/var/log/rails/site2.log
etc.

And also to have these logs auto-rotated every day.

How is this done?

/ Carsten


Source: (StackOverflow)

Centralized rsyslog : max size of message

I configured a centralized syslog on Ubuntu 12.04.

I set the max message size on both servers

$MaxMessageSize 20k

I have 2 different comportment :

  • client : message are logged completly
  • server : message are truncated at 2k

I can find configuration of any other buffer size.

Is it a limitation of rsyslog or a configuration problem ?

Thanks for your help.

Fred


Source: (StackOverflow)

Multiline log records in syslog

So I've configured my Python application to log to syslog with Python's SysLogHandler, and everything works fine. Except for multi-line handling. Not that I need to emit multiline log records so badly (I do a little), but I need to be able to read Python's exceptions. I'm using Ubuntu with rsyslog 4.2.0. This is what I'm getting:

Mar 28 20:11:59 telemachos root: ERROR 'EXCEPTION'#012Traceback (most recent call last):#012  File "./test.py", line 22, in <module>#012    foo()#012  File "./test.py", line 13, in foo#012    bar()#012  File "./test.py", line 16, in bar#012    bla()#012  File "./test.py", line 19, in bla#012    raise Exception("EXCEPTION!")#012Exception: EXCEPTION!

Test code in case you need it:

import logging
from logging.handlers import SysLogHandler

logger = logging.getLogger()
logger.setLevel(logging.INFO)
syslog = SysLogHandler(address='/dev/log', facility='local0')
formatter = logging.Formatter('%(name)s: %(levelname)s %(message)r')
syslog.setFormatter(formatter)
logger.addHandler(syslog)

def foo():
    bar()

def bar():
    bla()

def bla():
    raise Exception("EXCEPTION!")

try:
    foo()
except:
    logger.exception("EXCEPTION")

Source: (StackOverflow)

How to configure syslog so that an applications log goes to a specific file

I have an application myapp which should send log files only to /var/log/myapp.log. myapp is written in C++. The following sample code, sends the logs to /var/log/syslog only. My os is Linux - Ubuntu 12.04 - to be specific. I also found that my machine has rsyslog than syslog installed.

#include <stdio.h>
#include <unistd.h>
#include <syslog.h>

int main(void) {
    openlog("myapp", LOG_PID|LOG_CONS, LOG_USER);
    syslog(LOG_INFO, "abc 10");
    closelog();
    return 0;
}

Source: (StackOverflow)

How to increase php syslog maximum limit of 2048

Is there a simple way to log message greater than 2048 char using syslog? e.g raw response of a curl request.

// msg is a string > 2048 char. This truncates message to 2048 chars
syslog(LOG_DEBUG, msg);

Source: (StackOverflow)

duplicate log entries in Python UDP syslog server from iptables

I've implemented a basic remote syslog server in Python with the following code:

self.UDPsock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.UDPsock.bind(self.addr)
self.UDPsock.settimeout(1)
while self.carryOn:
  try: 
    data = self.UDPsock.recv(self.buf)
    print data
  except socket.timeout:
    pass

I'm using this to receive log messages from my router (Tomato Shibby v108). I'm particularly interested in intercepting messages from my mobile so that I can create a "presence" script.

I originally tried the following iptable entry for testing:

iptables -I FORWARD -s 192.168.2.54 -m limit --limit 1/minute --limit-burst 1 -j LOG

This worked as expected and I would receive messages such as:

<12>Apr  1 21:51:47 kernel: IN=br0 OUT=ppp0 SRC=192.168.2.54 DST=17.158.8.77 LEN=70 TOS=0x00 PREC=0x00 TTL=63 ID=23055 DF PROTO=TCP SPT=60779 DPT=993 WINDOW=65535 RES=0x00 ACK PSH URGP=0 MARK=0x5

However, I don't want to rely on a static IP, so changed the iptable filter to trigger on the MAC address:

iptables -t raw -A PREROUTING -m mac --mac-source SOURCE_MAC -m limit --limit 1/minute --limit-burst 1 -j LOG --log-ip-options

The problem here was that I now received >50 messages per log entry, all duplicates of the form:

<12>Apr  1 19:54:00 kernel: IN=br0 OUT= MAC=DEST_MAC:SOURCE_MAC:08:00 SRC=192.168.2.54 DST=224.0.0.251 LEN=101 TOS=0x00 PREC=0x00 TTL=255 ID=36530 PROTO=UDP SPT=5353 DPT=5353 LEN=81 

When I changed the filter to:

iptables -t raw -A PREROUTING -m mac --mac-source SOURCE_MAC -m limit --limit 1/minute --limit-burst 1 -j LOG

It reduced the number of duplicates to 4:

<12>Apr  2 12:21:55 kernel: IN=br0 OUT= MAC=DEST_MAC:SOURCE_MAC:08:00 SRC=192.168.2.54 DST=224.0.0.251 LEN=101 TOS=0x00 PREC=0x00 TTL=255 ID=1384 PROTO=UDP SPT=5353 DPT=5353 LEN=81 

Can anyone offer any insight as to why this is happening? I'm assuming there is some sort of "funny" character that is causing this. Can I alter either the iptable entry or the Python program to only receive a single log entry per message?


Source: (StackOverflow)

Heroku syslog drain : too many tcp sessions

I set a logging drain on my Heroku app, to send logs to my other server. My rsyslogd well receive the logs from Heroku, but after few hours, rsyslog start to drop packets because too many TCP connections are opened:

Oct 18 06:28:17 localhost rsyslogd-2079: too many tcp sessions - dropping incoming request [try http://www.rsyslog.com/e/2079 ]
Oct 18 06:28:24 localhost rsyslogd-2079: too many tcp sessions - dropping incoming request [try http://www.rsyslog.com/e/2079 ]
Oct 18 06:28:24 localhost rsyslogd-2079: too many tcp sessions - dropping incoming request [try http://www.rsyslog.com/e/2079 ]
Oct 18 06:28:26 localhost rsyslogd-2079: too many tcp sessions - dropping incoming request [try http://www.rsyslog.com/e/2079 ]
[...]

I try to increase the maximum sessions allowed into the rsyslogd configuration (I set it to 1000, which is normally enough to handle everything).

Same issue, so I increase this value to 3000. I have fewer issues now, but I think 3000 max sessions is paticulary high.

$ModLoad imtcp
$InputTCPServerRun 514
$InputTCPMaxSessions 3000

Do you think there is another thing to do? Do I need to decrease this number? Maybe there is something else to do to better deal with logs comming from Heroku LogPlex.


Source: (StackOverflow)

Send JSON from rsyslog to Kibana

I'm using rsyslog to watch over my syslogs and send them over to Logstash+Kibana.

My syslogs messages are logged as JSON. They can look something like this:

{"foo":"bar", "timegenerated": 43843274834}

rsyslog configuration as so:

module(load="omelasticsearch")

#define a template to print all fields of the message
template(name="messageToES" type="list" option.json="on") {
  property(name="msg")
}
*.* action(type="omelasticsearch"
       server="localserverhere"
       serverport="80"
       template="messageToES")

The Kibana is fine, since if I run a CURL command to it, it receives the record. The code as below:

curl -XPOST myserver/test/bar -d '{"test": "baz", "timegenerated":1447145221519}'

When I run rsyslogs and point it to a dummy server, I can see the incoming requests with the valid json. However, when I point it back to my logstash server, it doesn't show up in logstash or kibana.

Does anyone know how to send syslogs as json into Kibana/logstash?


Source: (StackOverflow)

Encrypt using SSL when writing syslog messages to a MySQL DB

I have a rsyslog configuration such that all our servers are logging to centralized logging MySQL DB. Everything I'm using is pretty default, just installed with apt-get install rsyslog. I have a config file /etc/rsyslog.d/20-basic.conf:

*.*       :ommysql:127.0.0.1,Syslog,syslogwriter,my_password

And this sends syslog logs to the Syslog DB (SystemEvent table) perfectly. I was just wondering if there was any easy way to use SSL for encryption when sending the logs to the DB.

The rsyslog doc has a link to: rsyslog provides native TLS/SSL encryption, but it leads to an invalid web page :(

I was wondering if this is even possible out of the box, or will it take quite a bit of hacking. If someone has some sample template/code or could even point me in the right direction, that would be awesome. Much appreciated!


Source: (StackOverflow)

syslog4j stops logging when rsyslog restarted

After a restart of the rsyslog daemon, syslog4j 0.9.46 can no longer successfully write to the syslog without restarting the java process. No exception is thrown and I see no way to check, via the API, whether logging is still working. Is there some way to get syslog4j to recover from a rsyslog restart, or at least throw an exception so that the connection can be manually restarted?

Sample code:

import java.util.Scanner;

import org.productivity.java.syslog4j.SyslogConstants;
import org.productivity.java.syslog4j.SyslogIF;
import org.productivity.java.syslog4j.impl.unix.socket.UnixSocketSyslog;
import org.productivity.java.syslog4j.impl.unix.socket.UnixSocketSyslogConfig;


public class SysLogging {

    public static void main(String[] args) {
        UnixSocketSyslogConfig cfg = new UnixSocketSyslogConfig();
        cfg.setFacility(SyslogConstants.FACILITY_LOCAL1);
        cfg.removeAllMessageModifiers();
        cfg.setIdent(null);
        cfg.setThrowExceptionOnWrite(true);
        cfg.setWriteRetries(5);
        SyslogIF log = new UnixSocketSyslog();
        log.initialize(SyslogConstants.UNIX_SOCKET, cfg);

        Scanner scanner = new Scanner(System.in);
        System.out.println("type quit to quit, anything else to log");
        String line = scanner.nextLine();
        while(!line.equals("quit")) {
            log.info(line);
            System.out.println("type quit to quit, anything else to log");
            line = scanner.nextLine();
        }
        scanner.close();
    }
}

The code above works as you'd think until rsyslog is restarted. At that point no more messages appear in the syslog although everything seems to work otherwise.


Source: (StackOverflow)

how to spoof hostname in syslog messages?

I am logging messages like this in perl -

syslog ("LOG_INFO", "this is info");
syslog ("LOG_WARNING", "this is warning");

when I see these messages, I get this-

Nov 15 20:20:47 ubuntu tag-0.0.2[13399]: this is info
Nov 15 20:20:47 ubuntu tag-0.0.2[13399]: this is warning

The word "ubuntu" in syslog message happens to be host name of the local host.

Is there a way I can log locally and but specify a hostname?

My app processes data from other hosts and logs information about them. It will be great if I can specify the host name when I log messages, this way I can use third party tools easily as they can easily filter out logs based upon hostname.

btw, if I can add additional question- why are the logs not showing level of message? shouldn't I expect to see "info" in info syslog message I am logging ?


Source: (StackOverflow)

Chef recipe to restart rsyslog

I've got a recipe that should install a template, and then restart the service...

service "rsyslog" do
  supports :restart => true, :reload => true
  action [:enable, :start]
end 

Chef::Log.info("Creating loggly rsyslog conf")
template "/etc/rsyslog.d/22-loggly.conf" do
  source "syslogd.conf.erb"
  mode "0755"
  owner "root"
  group "root"
  notifies :restart, resources(:service => "rsyslog")
end

Why am I getting:

ERROR: resource template[/etc/rsyslog.d/22-loggly.conf] is configured to notify resource service['rsyslog'] with action restart, but service['rsyslog'] cannot be found in the resource collection. template[/etc/rsyslog.d/22-loggly.conf] is defined in /home/ubuntu/cookbooks/loggly-syslog/recipes/default.rb:7:in `from_file'

[2014-01-03T23:26:37+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

How can I make rsyslog restart/reload after I add the config file??


Source: (StackOverflow)