Commit Graph

211 Commits

Author SHA1 Message Date
Tom Rhodes
42c3aae2ea Mark up keywords with .Cm.
PR:		95039
Sumitted by:	SeaD (older version)
Reviewed by:	ru
2006-10-12 01:59:34 +00:00
Ruslan Ermilov
bc84aa4ba3 Markup fixes. 2006-09-29 17:57:04 +00:00
Ruslan Ermilov
b3e2f7a6d8 Sync usage() with manpage's SYNOPSIS. 2006-09-29 17:36:38 +00:00
Yaroslav Tykhiy
6884810944 Obey MK_INET6_SUPPORT. 2006-07-27 14:52:12 +00:00
Julian Elischer
be389c75f0 Add the ability to log to an arbitrary udp port as well as the
standard syslog port. This allows syslog to easily export lines of interest to
an external logging system.
2006-04-17 20:12:35 +00:00
Christian S.J. Peron
ae4f0fc3a9 Currently, if writing out a log entry fails, we unlink that log entry from our
internal list of logfiles. So if writev(2) fails for potentially transient
errors like ENOSPC, syslogd requires a restart, even if the filesystem has
purged.

This change allows syslogd to ignore ENOSPC space errors, so that when the
filesystem is cleaned up, syslogd will automatically start logging again
without requiring the reset. This makes syslogd(8) a bit more reliable.

MFC after:	1 week
2006-03-30 21:04:52 +00:00
Pawel Jakub Dawidek
c503ddf2cc By default (for security reasons) syslogd(8) doesn't create log files
when they don't exist, but sometimes its quite useful (eg. we use
non-standard log files and memory backed /var/, which is populated on
boot).

Add -C option which tells syslogd(8) to create log files if they don't
exist.

Glanced at by:	phk
MFC after:	3 days
2006-03-06 10:36:33 +00:00
Julian Elischer
f47dba63bb Fix typo 2006-02-23 18:51:02 +00:00
Warner Losh
327608b266 style(9) nitlet:
foo() {
}

to

foo()
{
}
2005-10-17 16:51:06 +00:00
Olivier Houchard
c825862e6c setsockopt() will return -1 on error, not 0.
Pointy hat to:	Jeremie Le Hen
2005-09-28 16:14:43 +00:00
Olivier Houchard
20c0b2d3c3 Use SO_REUSEADDR on the socket, to make the use of syslogd in jails easier.
Submitted by:   Jeremie Le Hen <jeremie le-hen org>
2005-09-28 16:05:13 +00:00
Pawel Jakub Dawidek
fa39391686 Use pidfile(3) in syslogd(8). 2005-08-24 17:26:26 +00:00
Giorgos Keramidas
6fb9b618f5 Fix all the spelling mistakes I could find in the man pages for words
that have at least 3 characters.

MFC after:	1 week
Thanks to:	Music band ``Chingon''
		for keeping me company while searching for these.
2005-07-31 03:30:48 +00:00
Christian S.J. Peron
8e56d2ee05 Add cases for ENOBUFS and ENETDOWN. We need to make sure that we
catch all transient errors. This fixes situations where transient
error conditions such as network interfaces losing carrier signals
or the system running out of mbufs would result in the permanent
removal of forwarding syslog messages.

MFC after:	1 week
2005-05-19 21:09:44 +00:00
Hajimu UMEMOTO
4f10131848 NI_WITHSCOPEID cleanup. Neither RFC 2553 nor RFC 3493 defines
NI_WITHSCOPEID, and our getaddrinfo(3) does nothing special
for it, now.
2005-05-13 16:31:11 +00:00
Hiroki Sato
15f3d79b55 Add -S option which allows to change the pathname of the privileged
socket /var/run/logpriv.

Reviewed by:	glebius and kensmith
MFC after:	2 days
2005-04-13 03:19:41 +00:00
Gleb Smirnoff
b4e852907f Check that supplied facility is not bigger than LOG_NFACILITIES.
PR:		bin/79260
Submitted by:	Shuichi KITAGUCHI
2005-03-28 10:59:19 +00:00
Ruslan Ermilov
36a142c455 Expand contractions. 2005-02-13 23:45:54 +00:00
Ruslan Ermilov
0227791b40 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
Ruslan Ermilov
59a3c79da6 Sort sections. 2005-01-18 20:02:45 +00:00
Ruslan Ermilov
1a74e6a157 Scheduled mdoc(7) sweep. 2005-01-11 11:47:22 +00:00
David Malone
f56bb70ae6 Allow ':' and '%' in hostname specifications so that we can specify IPv6
addresses and scope IDs.

MFC after:	3 weeks
2004-12-28 22:25:04 +00:00
David Malone
62f29f306a Some syslog messages delimit the program tag with whitespace rather
than a colon, so don't allow whitespace in program names. To be
consistent with hostnames, don't allow whitespace in the program
name specifiers in syslog.conf either.

(The first change is by Markus from the PR, the second is mine.)

PR:		68691
Submitted by:	Markus Oestreicher <m.oe@x-trader.de>
MFC after:	3 weeks
2004-12-28 21:58:54 +00:00
Gleb Smirnoff
204d318009 s/priveleged/privileged/ 2004-11-18 13:37:33 +00:00
Giorgos Keramidas
d6c85264cd Fix a minor comment typo: priveleged = privileged. 2004-11-18 12:20:52 +00:00
Ruslan Ermilov
a7c23514f6 Really revert the whitespace change to usage(). 2004-11-11 18:09:00 +00:00
Gleb Smirnoff
24f3d18aa1 Change TABs back to spaces in usage string constants.
Requested by:	ru
2004-11-11 16:13:10 +00:00
Gleb Smirnoff
033b92f386 Whitespace.
Approved by:	cvs diff -b
2004-11-11 09:41:03 +00:00
Gleb Smirnoff
43af2cc4a5 Double receive buffer size on sockets.
PR:		bin/72366
Ok'd by:	dwmalone
Approved by:	julian (mentor)
Obtained from:	OpenBSD
MFC after:	1 month
2004-11-11 09:39:04 +00:00
Ken Smith
de655741ce Bump document date.
Noticed by:     trhodes
Pointy hat:     kensmith
MFC after:      1 week
2004-11-09 04:41:12 +00:00
Ken Smith
83d71f6175 Add newsyslog(8) to the "See Also" section.
MFC after:	1 week
2004-11-09 04:31:31 +00:00
Gleb Smirnoff
240d5a9b1c Protect against local flooder of /var/run/log. Do not loop forever in
syslog(3) if we are a priveleged program (sshd, su, etc.).

- Make syslogd open an additional socket /var/run/logpriv, with 0600
  permissions.
- In libc, try to use this socket.
- Do not loop forever if we are using this socket (partial backout of 1.31)

Reviewed by:	dwmalone, Andrea Campi <andrea webcom it>
Approved by:	julian (mentor)
MFC after:	1 month
2004-11-04 23:09:57 +00:00
Gleb Smirnoff
247444670e - Use stailqueue for sockets instead of socket buffer. Thus
remove limit for 20 sockets.
- Add possibility to specify file mode for sockets created with '-l'.
- Check that socket name in '-l' is absolute.

Reviewed by:	dwmalone, Andrea Campi <andrea webcom it>
Approved by:	julian (mentor)
2004-11-04 22:20:21 +00:00
Warner Losh
486c8cc4c6 Per letter dated July 22, 1999 remove 3rd clause of Berkeley derived software
(with permission of addtional copyright holders where appropriate)
2004-08-07 04:28:56 +00:00
Colin Percival
decbf84ef3 Fix dofsync() declaration.
Pointed out by:	dwmalone
2004-07-04 19:52:48 +00:00
Colin Percival
e1906bda7b Where syslogd would have fsync()ed a file in the past, instead set a flag
FFLAG_NEEDSYNC and fsync the file when select() next returns zero.  This
dramatically speeds up the process of logging large amounts of data, while
leaving the essential semantics (that data can be expected to be on disk
if we crash) unchanged.

In my tests, this speeds up the rc phase of booting by 18-20%. [1]

YES PLEASE! by:	phk [1]
2004-07-04 19:13:58 +00:00
Ruslan Ermilov
455fb174df Eliminated double whitespace. 2004-07-03 18:35:53 +00:00
Ruslan Ermilov
07bfccd71e Mechanically kill hard sentence breaks. 2004-07-02 23:13:00 +00:00
David Malone
2b1071b296 Also terminate program names if we hit a '/' - this is to be slightly
more friendly to postfix log messages.

PR:		50912
Submitted by:	Stanislav Lapshansky <slapsh@slapsh.pp.ru>
2004-05-30 10:34:58 +00:00
David Malone
0f2ffc4e31 A log file name may now be prefixed by a '-' if it should not be
explicitly fsynced after kernel messages are logged. This option
should be syntax compatible with a similar option in Linux syslogd.

I've made some small changes to Pekka's patch, hoepfully I haven't
goofed anything.

PR:		66790
Submitted by:	Pekka Savola <pekkas@netcore.fi>
Obtained from:	Martin Schulze's syslogd
MFC after:	1 month
2004-05-30 10:04:03 +00:00
David Malone
3b7e120185 Try to be more careful about using using the file descriptor f_file.
Syslogd should ensure that f_file is a valid file descriptor when
f_type is FILE, CONSOLE, TTY and for a PIPE where f_pid > 0. If the
descriptor is closed/invalid then the type should be set to UNUSED
or the pid should be set to 0.

To this end:
1) Don't close(f->f_file) if we can't send a message to a remote
   host because the file descriptor used for remote logging is
   stored in finet, not in f->f_file. f->f_file is probably
   uninitialised, so I guess we usually end up closing fd 0.
2) Don't close PIPE file descriptors if they are invalid.
3) If the call to p_open fails, don't set the pid.

The OpenBSD patches in this area set f_file to -1 after the fd is
closed and then avoids calling close if f_file < 0. I haven't done
this, but it might be a good idea too.

Inspired by:	PR 67139/OpenBSD
2004-05-30 00:02:19 +00:00
David Malone
75030d0676 Some string fixes.
1) Use strncpy on strings out of utmp.
2) Avoid running off the start of one string while removing white space.
   (I've used slightly different code to OpenBSD here.)
3) Ignore trailing spaces in the priority.

PR:		67139
Submitted by:	Xin LI <delphij@FreeBSD.org.cn>
Obtained from:	OpenBSD
2004-05-29 23:40:30 +00:00
David Malone
6f8c264082 Exit with a warning if the path to one of the logging sockets is
too long, rather than silently truncating them.

PR:		67139
Inspired by:	OpenBSD
2004-05-29 23:27:50 +00:00
David Malone
ac3a1548f8 Fix some bugs that don't manifest themselves in practice.
1) Don't check for getopt returning '?', we have a default case.
2) Check if the priority is LOG_KERN correctly - in practice
   LOG_KERN is 0, so it makes no difference. OpenBSD fixed a
   different nearby bug that we don't have 'cos our definition
   of LOG_MAKEPRI is different to OpenBSD's.

Copy a comment from OpenBSD, observing that LOG_KERN is 0.

Inspired by PR:		67139
2004-05-29 23:24:18 +00:00
David Malone
a944213190 Update a couple of comments.
PR:		67139
Submitted by:	Xin LI <[3]delphij@FreeBSD.org.cn>
Obtained from:	OpenBSD
2004-05-29 23:14:03 +00:00
David Malone
ef4dd325c4 Silence some constness and printf type warnings. Most of the
const fixes are ugly 'cos the types in an iovec aren't quite
right for a writev.
2004-05-26 21:14:13 +00:00
Ruslan Ermilov
47d7e8a96f Fixed style of DPADD and LDADD assignments as per style.Makefile(5). 2004-02-05 22:44:25 +00:00
Ian Dowse
9323dbdb0a Use strtol to parse the <%d> tags in printline() and printsys().
Sort local variables declarations in these functions.

Submitted by:	bde
2004-01-31 17:44:27 +00:00
Ian Dowse
ff96c77dc4 Be much more strict about parsing tagged log messages from /dev/klog;
if the line doesn't match ^<%d>, then treat it as a regular kernel
printf line. Previously if a kernel printf message started with "<"
it would be interpreted as a log message, often with LOG_EMERG
level. This was triggered by some printfs in sys/dev/aic7xxx/, and
can also happen with the partial lines that result if syslogd cannot
keep up with the rate of arrival of kernel messages.

Reviewed by:	dwmalone
MFC after:	1 week
2004-01-26 00:46:46 +00:00
David Malone
de4aac0deb logerror is used in syslogd to log errors from syslogd itself. It
is possible for an error to occur while trying to log an error, and
this can result in infinite recursion (or at least until we run out
of stack).

Rather than this, we ignore requests to log an error while logging an
error.

PR:		51253
MFC after:	2 weeks
2003-11-16 21:51:06 +00:00