xref: /netbsd-src/usr.sbin/syslogd/syslogd.8 (revision bada23909e740596d0a3785a73bd3583a9807fb8)
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 acknowledgment:
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.\"     from: @(#)syslogd.8	8.1 (Berkeley) 6/6/93
33.\"	$NetBSD: syslogd.8,v 1.12 1999/03/19 00:53:31 perry Exp $
34.\"
35.Dd February 18, 1999
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 ds
44.Bk -words
45.Op Fl f Ar config_file
46.Ek
47.Bk -words
48.Op Fl m Ar mark_interval
49.Ek
50.Bk -words
51.Op Fl P Ar file_list
52.Ek
53.Bk -words
54.Op Fl p Ar log_socket
55.Ek
56.Bk -words
57.Op Fl p Ar log_socket2 ...
58.Ek
59.Sh DESCRIPTION
60.Nm
61reads and logs messages to the system console, log files, other
62machines and/or users as specified by its configuration file.
63The options are as follows:
64.Bl -tag -width Ds
65.It Fl d
66Enable debugging to the standard output,
67and do not disassociate from the controlling terminal.
68.It Fl f
69Specify the pathname of an alternative configuration file;
70the default is
71.Pa /etc/syslog.conf .
72.It Fl m
73Select the number of minutes between ``mark'' messages;
74the default is 20 minutes.
75.It Fl s
76Select ``secure'' mode, in which syslogd does not open a UDP socket but
77only communicates over a
78.Ux
79domain socket.
80This is valuable when the machine on
81which syslogd runs is subject to attack over the network and it is desired
82that the machine be protected from attempts to remotely fill logs
83and similar attacks.
84.It Fl p
85Specify the pathname of an log socket.  Multiple
86.Fl p
87options create multiple log sockets.  If no -p arguments are created,
88the default socket of
89.Pa /var/run/log
90is used.
91.It Fl P
92Specify the pathname of a file containing a list of sockets to be
93created.  The format of the file is simply one socket per line.
94.El
95.Pp
96.Nm
97reads its configuration file when it starts up and whenever it
98receives a hangup signal.
99For information on the format of the configuration file,
100see
101.Xr syslog.conf 5 .
102.Pp
103.Nm
104reads messages from the
105.Ux
106domain socket
107.Pa /var/run/log ,
108from an Internet domain socket specified in
109.Pa /etc/services ,
110and from the special device
111.Pa /dev/klog
112(to read kernel messages).
113.Pp
114.Nm
115creates the file
116.Pa /var/run/syslog.pid ,
117and stores its process
118id there.
119This can be used to kill or reconfigure
120.Nm "" .
121.Pp
122By using multiple
123.Fl p
124options, one can setup many chroot environments by passing the pathname
125to the log socket
126.Pa ( /var/run/log )
127in each chroot area to syslogd.  For example:
128.Dl syslogd -p /var/run/log -p /web/var/run/log -p /ftp/var/run/log
129.Pp
130note: the normal log socket must now also be passed to syslogd.
131.Sh SYSLOG PROTOCOL NOTES
132.Pp
133The message sent to
134.Nm
135should consist of a single line.
136The message can contain a priority code, which should be a preceding
137decimal number in angle braces, for example,
138.Sq Aq 5.
139This priority code should map into the priorities defined in the
140include file
141.Aq Pa sys/syslog.h .
142.Sh FILES
143.Bl -tag -width /var/run/syslog.pid -compact
144.It Pa /etc/syslog.conf
145The configuration file.
146.It Pa /var/run/syslog.pid
147The process id of current
148.Nm "" .
149.It Pa /var/run/log
150Name of the
151.Ux
152domain datagram log socket.
153.It Pa /dev/klog
154The kernel log device.
155.El
156.Sh SEE ALSO
157.Xr logger 1 ,
158.Xr syslog 3 ,
159.Xr services 5 ,
160.Xr syslog.conf 5
161.Sh HISTORY
162The
163.Nm
164command appeared in
165.Bx 4.3 .
166Support for multiple log sockets appeared in
167.Nx 1.4 .
168