xref: /netbsd-src/usr.sbin/syslogd/syslogd.8 (revision 1ca5c1b28139779176bd5c13ad7c5f25c0bcd5f8)
1.\"	$NetBSD: syslogd.8,v 1.24 2002/01/19 11:45:03 wiz Exp $
2.\"
3.\" Copyright (c) 1983, 1986, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the University of
17.\"	California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"     from: @(#)syslogd.8	8.1 (Berkeley) 6/6/93
35.\"
36.Dd February 18, 1999
37.Dt SYSLOGD 8
38.Os
39.Sh NAME
40.Nm syslogd
41.Nd log systems messages
42.Sh SYNOPSIS
43.Nm "
44.Op Fl dsSn
45.Bk -words
46.Op Fl f Ar config_file
47.Ek
48.Bk -words
49.Op Fl u Ar user
50.Ek
51.Bk -words
52.Op Fl g Ar user
53.Ek
54.Bk -words
55.Op Fl t Ar chroot_dir
56.Ek
57.Bk -words
58.Op Fl m Ar mark_interval
59.Ek
60.Bk -words
61.Op Fl P Ar file_list
62.Ek
63.Bk -words
64.Op Fl p Ar log_socket
65.Ek
66.Bk -words
67.Op Fl p Ar log_socket2 ...
68.Ek
69.Sh DESCRIPTION
70.Nm
71reads and logs messages to the system console, log files, other
72machines and/or users as specified by its configuration file.
73The options are as follows:
74.Bl -tag -width Ds
75.It Fl d
76Enable debugging to the standard output,
77and do not disassociate from the controlling terminal.
78.It Fl f
79Specify the pathname of an alternative configuration file;
80the default is
81.Pa /etc/syslog.conf .
82.It Fl u Ar user
83Set UID to
84.Ar user
85after the sockets and log files have been open.
86.It Fl g Ar group
87Set GID to
88.Ar group
89after the sockets and log files have been open.
90.It Fl t Ar chroot_dir
91.Xr chroot 2
92to
93.Ar chroot_dir
94after the sockets and log files 	have been open.
95.It Fl m
96Select the number of minutes between ``mark'' messages;
97the default is 20 minutes.
98.It Fl n
99Do not perform hostname lookups; report only numeric addresses.
100.It Fl s
101Select ``secure'' mode, in which syslogd does not listen on a UDP socket but
102only communicates over a
103.Ux
104domain socket.
105This is valuable when the machine on
106which syslogd runs is subject to attack over the network and it is desired
107that the machine be protected from attempts to remotely fill logs
108and similar attacks.
109.It Fl p
110Specify the pathname of an log socket.  Multiple
111.Fl p
112options create multiple log sockets.  If no -p arguments are created,
113the default socket of
114.Pa /var/run/log
115is used.
116.It Fl P
117Specify the pathname of a file containing a list of sockets to be
118created.  The format of the file is simply one socket per line.
119.El
120.Pp
121.Nm
122reads its configuration file when it starts up and whenever it
123receives a hangup signal.
124For information on the format of the configuration file,
125see
126.Xr syslog.conf 5 .
127.Pp
128.Nm
129reads messages from the
130.Ux
131domain socket
132.Pa /var/run/log ,
133from an Internet domain socket specified in
134.Pa /etc/services ,
135and from the special device
136.Pa /dev/klog
137(to read kernel messages).
138.Pp
139.Nm
140creates the file
141.Pa /var/run/syslogd.pid ,
142and stores its process
143id there.
144This can be used to kill or reconfigure
145.Nm "" .
146.Pp
147By using multiple
148.Fl p
149options, one can setup many chroot environments by passing the pathname
150to the log socket
151.Pa ( /var/run/log )
152in each chroot area to syslogd.  For example:
153.Dl syslogd -p /var/run/log -p /web/var/run/log -p /ftp/var/run/log
154.Pp
155note: the normal log socket must now also be passed to syslogd.
156.Pp
157Accesses from UDP socket can be filtered by libwrap configuration files, like
158.Pa /etc/hosts.deny .
159Specify
160.Dq Li syslogd
161in
162.Ar daemon_list
163portion of the configuration files.
164Refer to
165.Xr hosts_access 5
166for details.
167.Sh SYSLOG PROTOCOL NOTES
168.Pp
169The message sent to
170.Nm
171should consist of a single line.
172The message can contain a priority code, which should be a preceding
173decimal number in angle braces, for example,
174.Sq Aq 5 .
175This priority code should map into the priorities defined in the
176include file
177.Aq Pa sys/syslog.h .
178.Sh FILES
179.Bl -tag -width /var/run/syslogd.pid -compact
180.It Pa /etc/syslog.conf
181The configuration file.
182.It Pa /var/run/syslogd.pid
183The process id of current
184.Nm "" .
185.It Pa /var/run/log
186Name of the
187.Ux
188domain datagram log socket.
189.It Pa /dev/klog
190The kernel log device.
191.El
192.Sh SEE ALSO
193.Xr logger 1 ,
194.Xr newsyslog 8 ,
195.Xr syslog 3 ,
196.Xr services 5 ,
197.Xr syslog.conf 5
198.Sh HISTORY
199The
200.Nm
201command appeared in
202.Bx 4.3 .
203Support for multiple log sockets appeared in
204.Nx 1.4 .
205libwrap support appeared in
206.Nx 1.6 .
207