1RSYSLOGD(8) Linux System Administration RSYSLOGD(8)
2
3
4
6 rsyslogd - reliable and extended syslogd
7
9 rsyslogd [ -d ] [ -D ] [ -f config file ] [ -i pid file ] [ -n ] [ -N
10 level ] [ -C ] [ -v ]
11
13 Rsyslogd is a system utility providing support for message logging.
14 Support of both internet and unix domain sockets enables this utility
15 to support both local and remote logging.
16
17 Note that this version of rsyslog ships with extensive documentation in
18 html format. This is provided in the ./doc subdirectory and probably
19 in a separate package if you installed rsyslog via a packaging system.
20 To use rsyslog's advanced features, you need to look at the html docu‐
21 mentation, because the man pages only covers basic aspects of opera‐
22 tion. For details and configuration examples, see the rsyslog.conf (5)
23 man page and the online documentation at http://www.rsyslog.com/doc
24
25 Rsyslogd(8) is derived from the sysklogd package which in turn is
26 derived from the stock BSD sources.
27
28 Rsyslogd provides a kind of logging that many modern programs use.
29 Every logged message contains at least a time and a hostname field,
30 normally a program name field, too, but that depends on how trusty the
31 logging program is. The rsyslog package supports free definition of
32 output formats via templates. It also supports precise timestamps and
33 writing directly to databases. If the database option is used, tools
34 like phpLogCon can be used to view the log data.
35
36 While the rsyslogd sources have been heavily modified a couple of notes
37 are in order. First of all there has been a systematic attempt to
38 ensure that rsyslogd follows its default, standard BSD behavior. Of
39 course, some configuration file changes are necessary in order to sup‐
40 port the template system. However, rsyslogd should be able to use a
41 standard syslog.conf and act like the original syslogd. However, an
42 original syslogd will not work correctly with a rsyslog-enhanced con‐
43 figuration file. At best, it will generate funny looking file names.
44 The second important concept to note is that this version of rsyslogd
45 interacts transparently with the version of syslog found in the stan‐
46 dard libraries. If a binary linked to the standard shared libraries
47 fails to function correctly we would like an example of the anomalous
48 behavior.
49
50 The main configuration file /etc/rsyslog.conf or an alternative file,
51 given with the -f option, is read at startup. Any lines that begin
52 with the hash mark (``#'') and empty lines are ignored. If an error
53 occurs during parsing the error element is ignored. It is tried to
54 parse the rest of the line.
55
56
58 -D Runs the Bison config parser in debug mode. This may help when
59 hard to find syntax errors are reported. Please note that the
60 output generated is deeply technical and orignally targeted
61 towards developers.
62
63 -d Turns on debug mode. See the DEBUGGING section for more informa‐
64 tion.
65
66 -f config file
67 Specify an alternative configuration file instead of /etc/rsys‐
68 log.conf, which is the default.
69
70 -i pid file
71 Specify an alternative pid file instead of the default one.
72 This option must be used if multiple instances of rsyslogd
73 should run on a single machine.
74
75 -n Avoid auto-backgrounding. This is needed especially if the
76 rsyslogd is started and controlled by init(8).
77
78 -N level
79 Do a coNfig check. Do NOT run in regular mode, just check con‐
80 figuration file correctness. This option is meant to verify a
81 config file. To do so, run rsyslogd interactively in foreground,
82 specifying -f <config-file> and -N level. The level argument
83 modifies behaviour. Currently, 0 is the same as not specifying
84 the -N option at all (so this makes limited sense) and 1 actu‐
85 ally activates the code. Later, higher levels will mean more
86 verbosity (this is a forward-compatibility option).
87
88 -C This prevents rsyslogd from changing to the root directory. This
89 is almost never a good idea in production use. This option was
90 introduced in support of the internal testbed.
91
92 -v Print version and exit.
93
95 Rsyslogd reacts to a set of signals. You may easily send a signal to
96 rsyslogd using the following:
97
98 kill -SIGNAL $(cat /var/run/syslogd.pid)
99
100 Note that -SIGNAL must be replaced with the actual signal you are try‐
101 ing to send, e.g. with HUP. So it then becomes:
102
103 kill -HUP $(cat /var/run/syslogd.pid)
104
105 HUP This lets rsyslogd perform close all open files.
106
107 TERM , INT , QUIT
108 Rsyslogd will die.
109
110 USR1 Switch debugging on/off. This option can only be used if rsys‐
111 logd is started with the -d debug option.
112
113 CHLD Wait for childs if some were born, because of wall'ing messages.
114
116 There is the potential for the rsyslogd daemon to be used as a conduit
117 for a denial of service attack. A rogue program(mer) could very easily
118 flood the rsyslogd daemon with syslog messages resulting in the log
119 files consuming all the remaining space on the filesystem. Activating
120 logging over the inet domain sockets will of course expose a system to
121 risks outside of programs or individuals on the local machine.
122
123 There are a number of methods of protecting a machine:
124
125 1. Implement kernel firewalling to limit which hosts or networks
126 have access to the 514/UDP socket.
127
128 2. Logging can be directed to an isolated or non-root filesystem
129 which, if filled, will not impair the machine.
130
131 3. The ext2 filesystem can be used which can be configured to limit
132 a certain percentage of a filesystem to usage by root only.
133 NOTE that this will require rsyslogd to be run as a non-root
134 process. ALSO NOTE that this will prevent usage of remote log‐
135 ging on the default port since rsyslogd will be unable to bind
136 to the 514/UDP socket.
137
138 4. Disabling inet domain sockets will limit risk to the local
139 machine.
140
141 Message replay and spoofing
142 If remote logging is enabled, messages can easily be spoofed and
143 replayed. As the messages are transmitted in clear-text, an attacker
144 might use the information obtained from the packets for malicious
145 things. Also, an attacker might replay recorded messages or spoof a
146 sender's IP address, which could lead to a wrong perception of system
147 activity. These can be prevented by using GSS-API authentication and
148 encryption. Be sure to think about syslog network security before
149 enabling it.
150
152 When debugging is turned on using the -d option, rsyslogd produces
153 debugging information according to the RSYSLOG_DEBUG environment vari‐
154 able and the signals received. When run in foreground, the information
155 is written to stdout. An additional output file can be specified using
156 the RSYSLOG_DEBUGLOG environment variable.
157
159 /etc/rsyslog.conf
160 Configuration file for rsyslogd. See rsyslog.conf(5) for exact
161 information.
162 /dev/log
163 The Unix domain socket to from where local syslog messages are
164 read.
165 /var/run/syslogd.pid
166 The file containing the process id of rsyslogd.
167 prefix/lib/rsyslog
168 Default directory for rsyslogd modules. The prefix is specified
169 during compilation (e.g. /usr/local).
171 RSYSLOG_DEBUG
172 Controls runtime debug support. It contains an option string
173 with the following options possible (all are case insensitive):
174
175 Debug Turns on debugging and prevents forking. This is pro‐
176 cessed earlier in the startup than command line options
177 (i.e. -d) and as such enables earlier debugging output.
178 Mutually exclusive with DebugOnDemand.
179 DebugOnDemand
180 Enables debugging but turns off debug output. The output
181 can be toggled by sending SIGUSR1. Mutually exclusive
182 with Debug.
183 LogFuncFlow
184 Print out the logical flow of functions (entering and
185 exiting them)
186 FileTrace
187 Specifies which files to trace LogFuncFlow. If not set
188 (the default), a LogFuncFlow trace is provided for all
189 files. Set to limit it to the files specified.FileTrace
190 may be specified multiple times, one file each (e.g.
191 export RSYSLOG_DEBUG="LogFuncFlow FileTrace=vm.c File‐
192 Trace=expr.c"
193 PrintFuncDB
194 Print the content of the debug function database whenever
195 debug information is printed (e.g. abort case)!
196 PrintAllDebugInfoOnExit
197 Print all debug information immediately before rsyslogd
198 exits (currently not implemented!)
199 PrintMutexAction
200 Print mutex action as it happens. Useful for finding
201 deadlocks and such.
202 NoLogTimeStamp
203 Do not prefix log lines with a timestamp (default is to
204 do that).
205 NoStdOut
206 Do not emit debug messages to stdout. If RSYSLOG_DEBUGLOG
207 is not set, this means no messages will be displayed at
208 all.
209 Help Display a very short list of commands - hopefully a life
210 saver if you can't access the documentation...
211
212 RSYSLOG_DEBUGLOG
213 If set, writes (almost) all debug message to the specified log
214 file in addition to stdout.
215 RSYSLOG_MODDIR
216 Provides the default directory in which loadable modules reside.
217
219 Please review the file BUGS for up-to-date information on known bugs
220 and annoyances.
221
223 Please visit http://www.rsyslog.com/doc for additional information,
224 tutorials and a support forum.
225
227 rsyslog.conf(5), logger(1), syslog(2), syslog(3), services(5),
228 savelog(8)
229
231 rsyslogd is derived from sysklogd sources, which in turn was taken from
232 the BSD sources. Special thanks to Greg Wettstein (greg@wind.enjel‐
233 lic.com) and Martin Schulze (joey@linux.de) for the fine sysklogd pack‐
234 age.
235
236 Rainer Gerhards
237 Adiscon GmbH
238 Grossrinderfeld, Germany
239 rgerhards@adiscon.com
240
241
242
243Version 8.6.0 02 Dec 2014 RSYSLOGD(8)