xref: /freebsd/usr.sbin/syslogd/syslogd.8 (revision d1ba25f456132eabc6f1244e4bbbf3d19e8f3a31)
1.\" Copyright (c) 1983, 1986, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by the University of
15.\"	California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"     @(#)syslogd.8	8.1 (Berkeley) 6/6/93
33.\" $FreeBSD$
34.\"
35.Dd October 12, 1995
36.Dt SYSLOGD 8
37.Os BSD 4.2
38.Sh NAME
39.Nm syslogd
40.Nd log systems messages
41.Sh SYNOPSIS
42.Nm
43.Op Fl dknsuv
44.Op Fl a Ar allowed_peer
45.Op Fl f Ar config_file
46.Op Fl m Ar mark_interval
47.Op Fl p Ar log_socket
48.Op Fl l Ar path
49.Sh DESCRIPTION
50The
51.Nm
52daemon reads and logs messages to the system console, log files, other
53machines and/or users as specified by its configuration file.
54.Pp
55The options are as follows:
56.Bl -tag -width indent
57.It Fl a Ar allowed_peer
58Allow
59.Ar allowed_peer
60to log to this
61.Nm
62using UDP datagrams.  Multiple
63.Fl a
64options may be specified.
65.Pp
66.Ar Allowed_peer
67can be any of the following:
68.Bl -tag -width "ipaddr/masklen[:service]XX"
69.It Ar ipaddr/masklen Ns Op Ar :service
70Accept datagrams from
71.Ar ipaddr
72(in the usual dotted quad notation) with
73.Ar masklen
74bits being taken into account when doing the address comparison.  If
75specified,
76.Ar service
77is the name or number of an UDP service (see
78.Xr services 5 ) Ns
79the source packet must belong to.  A
80.Ar service
81of
82.Ql \&*
83allows packets being sent from any UDP port.  The default
84.Ar service
85is
86.Ql syslog .
87A missing
88.Ar masklen
89will be substituted by the historic class A or class B netmasks if
90.Ar ipaddr
91belongs into the address range of class A or B, respectively, or
92by 24 otherwise.
93.It Ar domainname Ns Op Ar :service
94Accept datagrams where the reverse address lookup yields
95.Ar domainname
96for the sender address.  The meaning of
97.Ar service
98is as explained above.
99.It Ar *domainname Ns Op Ar :service
100Same as before, except that any source host whose name
101.Em ends
102in
103.Ar domainname
104will get permission.
105.El
106.It Fl d
107Put
108.Nm
109into debugging mode.  This is probably only of use to developers working on
110.Nm Ns .
111.It Fl f
112Specify the pathname of an alternate configuration file;
113the default is
114.Pa /etc/syslog.conf .
115.It Fl k
116Disable the translation of
117messages received with facility
118.Dq kern
119to facility
120.Dq user .
121Usually the
122.Dq kern
123facility is reserved for messages read directly from
124.Pa /dev/klog .
125.It Fl m
126Select the number of minutes between
127.Dq mark
128messages; the default is 20 minutes.
129.It Fl n
130Disable dns query for every request.
131.It Fl p
132Specify the pathname of an alternate log socket to be used instead;
133the default is
134.Pa /var/run/log .
135.It Fl l
136Specify a location where
137.Nm
138should place an additional log socket.
139Up to 19 additional logging sockets can be specified.
140The primary use for this is to place additional log sockets in
141.Pa /var/run/log
142of various chroot filespaces.
143.It Fl s
144Operate in secure mode.  Do not log messages from remote machines.  If
145specified twice, no network socket will be opened at all, which also
146disables logging to remote machines.
147.It Fl u
148Unique priority logging.  Only log messages at the specified priority.
149Without this option, messages at the stated priority or higher are logged.
150This option changes the default comparison from
151.Dq =>
152to
153.Dq = .
154.It Fl v
155Verbose logging.  If specified once, the numeric facility and priority are
156logged with each locally-written message.  If specified more than once,
157the names of the facility and priority are logged with each locally-written
158message.
159.El
160.Pp
161The
162.Nm
163daemon reads its configuration file when it starts up and whenever it
164receives a hangup signal.
165For information on the format of the configuration file,
166see
167.Xr syslog.conf 5 .
168.Pp
169The
170.Nm
171daemon reads messages from the
172.Tn UNIX
173domain socket
174.Pa /var/run/log ,
175from an Internet domain socket specified in
176.Pa /etc/services ,
177and from the special device
178.Pa /dev/klog
179(to read kernel messages).
180.Pp
181The
182.Nm
183daemon creates the file
184.Pa /var/run/syslog.pid ,
185and stores its process
186id there.
187This can be used to kill or reconfigure
188.Nm Ns .
189.Pp
190The message sent to
191.Nm
192should consist of a single line.
193The message can contain a priority code, which should be a preceding
194decimal number in angle braces, for example,
195.Sq Aq 5.
196This priority code should map into the priorities defined in the
197include file
198.Aq Pa sys/syslog.h .
199.Sh FILES
200.Bl -tag -width /var/run/syslog.pid -compact
201.It Pa /etc/syslog.conf
202configuration file
203.It Pa /var/run/syslog.pid
204process id of current
205.Nm
206.It Pa /var/run/log
207name of the
208.Tn UNIX
209domain datagram log socket
210.It Pa /dev/klog
211kernel log device
212.El
213.Sh SEE ALSO
214.Xr logger 1 ,
215.Xr syslog 3 ,
216.Xr services 5 ,
217.Xr syslog.conf 5
218.Sh HISTORY
219The
220.Nm
221command appeared in
222.Bx 4.3 .
223.Pp
224The
225.Fl a ,
226.Fl s ,
227.Fl u ,
228and
229.Fl v
230options are
231.Fx 2.2
232extensions.
233.Sh BUGS
234The ability to log messages received in UDP packets is equivalent to
235an unauthenticated remote disk-filling service, and should probably be
236disabled by default.  Some sort of
237.No inter- Ns Nm syslogd
238authentication mechanism ought to be worked out.  To prevent the worst
239abuse, use of the
240.Fl a
241option is therefore highly recommended.
242.Pp
243The
244.Fl a
245matching algorithm doesn't pretend to be very efficient; use of numeric
246IP addresses is faster than domain name comparison.  Since the allowed
247peer list is being walked linearly, peer groups where frequent messages
248are being anticipated from should be put early into the
249.Fl a
250list.
251.Pp
252The log socket was moved from
253.Pa /dev
254to ease the use of a read-only root filesystem.
255This may confuse
256some old binaries so that a symbolic link might be used for a
257transitional period.
258