xref: /freebsd/usr.sbin/syslogd/syslogd.8 (revision 23f282aa31e9b6fceacd449020e936e98d6f2298)
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 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.
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 comparision.  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 m
116Select the number of minutes between
117.Dq mark
118messages; the default is 20 minutes.
119.It Fl p
120Specify the pathname of an alternate log socket to be used instead;
121the default is
122.Pa /var/run/log .
123.It Fl l
124Specify a location where
125.Nm
126should place an additional log socket.
127Up to 19 additional logging sockets can be specified.
128The primary use for this is to place additional log sockets in
129.Pa /var/run/log
130of various chroot filespaces.
131.It Fl s
132Operate in secure mode.  Do not log messages from remote machines.  If
133specified twice, no network socket will be opened at all, which also
134disables logging to remote machines.
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.
243This may confuse
244some old binaries so that a symbolic link might be used for a
245transitional period.
246