xref: /freebsd/usr.sbin/syslogd/syslogd.8 (revision 6e8394b8baa7d5d9153ab90de6824bcd19b3b4e1)
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.\"	$Id: syslogd.8,v 1.16 1998/07/22 06:15:18 phk Exp $
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 dsuv
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.
54The options are as follows:
55.Bl -tag -width indent
56.It Fl a Ar allowed_peer
57Allow
58.Ar allowed_peer
59to log to this
60.Nm
61using UDP datagrams.  Multiple
62.Fl a
63options may be specified.
64.Pp
65.Ar Allowed_peer
66can be any of the following:
67.Bl -tag -width "ipaddr/masklen[:service]XX"
68.It Ar ipaddr/masklen Ns Op Ar :service
69Accept datagrams from
70.Ar ipaddr
71(in the usual dotted quad notation) with
72.Ar masklen
73bits being taken into account when doing the address comparision.  If
74specified,
75.Ar service
76is the name or number of an UDP service (see
77.Xr services 5 ) Ns
78the source packet must belong to.  A
79.Ar service
80of
81.Ql \&*
82allows packets being sent from any UDP port.  The default
83.Ar service
84is
85.Ql syslog .
86A missing
87.Ar masklen
88will be substituted by the historic class A or class B netmasks if
89.Ar ipaddr
90belongs into the address range of class A or B, respectively, or
91by 24 otherwise.
92.It Ar domainname Ns Op Ar :service
93Accept datagrams where the reverse address lookup yields
94.Ar domainname
95for the sender address.  The meaning of
96.Ar service
97is as explained above.
98.It Ar *domainname Ns Op Ar :service
99Same as before, except that any source host whose name
100.Em ends
101in
102.Ar domainname
103will get permission.
104.El
105.It Fl d
106Put
107.Nm
108into debugging mode.  This is probably only of use to developers working on
109.Nm Ns .
110.It Fl f
111Specify the pathname of an alternate configuration file;
112the default is
113.Pa /etc/syslog.conf .
114.It Fl m
115Select the number of minutes between
116.Dq mark
117messages; the default is 20 minutes.
118.It Fl p
119Specify the pathname of an alternate log socket to be used instead;
120the default is
121.Pa /var/run/log .
122.It Fl l
123Specify a location where
124.Nm syslogd
125should place an additional log socket.
126Up to 19 additional logging sockets can be specified.
127The primary use for this is to place additional log sockets in
128.Pa /dev/log
129of various chroot filespaces.
130.It Fl s
131Operate in secure mode.  Do not log messages from remote machines.  If
132specified once, the messages will be received and counted and a log
133entry produced every time the count exceeds a power of two.  If
134specified twice, no network socket will be opened at all.
135.It Fl u
136Unique priority logging.  Only log messages at the specified priority.
137Without this option, messages at the stated priority or higher are logged.
138This option changes the default comparison from
139.Dq =>
140to
141.Dq = .
142.It Fl v
143Verbose logging.  If specified once, the numeric facility and priority are
144logged with each locally-written message.  If specified more than once,
145the names of the facility and priority are logged with each locally-written
146message.
147.El
148.Pp
149The
150.Nm
151daemon reads its configuration file when it starts up and whenever it
152receives a hangup signal.
153For information on the format of the configuration file,
154see
155.Xr syslog.conf 5 .
156.Pp
157The
158.Nm
159daemon reads messages from the
160.Tn UNIX
161domain socket
162.Pa /var/run/log ,
163from an Internet domain socket specified in
164.Pa /etc/services ,
165and from the special device
166.Pa /dev/klog
167(to read kernel messages).
168.Pp
169The
170.Nm
171daemon creates the file
172.Pa /var/run/syslog.pid ,
173and stores its process
174id there.
175This can be used to kill or reconfigure
176.Nm Ns .
177.Pp
178The message sent to
179.Nm
180should consist of a single line.
181The message can contain a priority code, which should be a preceding
182decimal number in angle braces, for example,
183.Sq Aq 5.
184This priority code should map into the priorities defined in the
185include file
186.Aq Pa sys/syslog.h .
187.Sh FILES
188.Bl -tag -width /var/run/syslog.pid -compact
189.It Pa /etc/syslog.conf
190configuration file
191.It Pa /var/run/syslog.pid
192process id of current
193.Nm
194.It Pa /var/run/log
195name of the
196.Tn UNIX
197domain datagram log socket
198.It Pa /dev/klog
199kernel log device
200.El
201.Sh SEE ALSO
202.Xr logger 1 ,
203.Xr syslog 3 ,
204.Xr services 5 ,
205.Xr syslog.conf 5
206.Sh HISTORY
207The
208.Nm
209command appeared in
210.Bx 4.3 .
211.Pp
212The
213.Fl a ,
214.Fl s ,
215.Fl u ,
216and
217.Fl v
218options are
219.Fx 2.2
220extensions.
221.Sh BUGS
222The ability to log messages received in UDP packets is equivalent to
223an unauthenticated remote disk-filling service, and should probably be
224disabled by default.  Some sort of
225.No inter- Ns Nm syslogd
226authentication mechanism ought to be worked out.  To prevent the worst
227abuse, use of the
228.Fl a
229option is therefore highly recommended.
230.Pp
231The
232.Fl a
233matching algorithm doesn't pretend to be very efficient; use of numeric
234IP addresses is faster than domain name comparision.  Since the allowed
235peer list is being walked linearly, peer groups where frequent messages
236are being anticipated from should be put early into the
237.Fl a
238list.
239.Pp
240The log socket was moved from
241.Pa /dev
242to ease the use of a read-only root filesystem. This may confuse
243some old binaries so that a symbolic link might be used for a
244transitional period.
245