| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| | |
Fix typos in comments (returing -> returning)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
r313358:
Sort sys/ #includes and zap an unnecessary trailing space nearby
r313360:
Sort sys/ #includes some more
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
syslogd: Enable repeated line compression for lines of any length.
Enable repeated line compression for lines of any length, instead of only short
lines. AFAICT repeated line compression was limited to short lines as a RAM
optimization, which made sense when karels added it in 1988, but no longer.
The penalty is a paltry 904B of RAM per file logged.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
in the foreground.
This allows a separate process to monitor when and how syslogd exits. That
process can then restart syslogd if needed.
Approved by: jhb
Sponsored by: Panasas, Inc.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Set f_file to -1/F_UNUSED when after closing when possible
This will help ensure we don't trash file descriptors that get used later on
in the daemon
Found via internal Coverity scan
Discussed with: cem, ed, markj
Differential Revision: https://reviews.freebsd.org/D3081
Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
Sponsored by: EMC / Isilon Storage Division
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make syslogd work in case shutdown() is POSIX-ly correct.
On POSIX conformant systems, shutdown() should return ENOTCONN when not
connected. We attempted to fix this once (kern/84761), but this change
got backed out because it 'breaks code' (r150155).
I just reapplied the patch and indeed, syslogd fails on startup. Make it
easier to re-enable this change in the future by paching up syslogd to
do the right thing.
Sponsored by: Nuxi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix two clang 3.6.0 warnings in usr.sbin/syslogd:
usr.sbin/syslogd/syslogd.c:1023:10: error: address of array 'f->f_prevline' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
f->f_prevline && !strcmp(msg, f->f_prevline) &&
~~~^~~~~~~~~~
usr.sbin/syslogd/syslogd.c:1178:16: error: address of array 'f->f_prevline' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
} else if (f->f_prevline) {
~~ ~~~^~~~~~~~~~
In both cases, the f_prevline field of struct filed is a char array, so
it can never be null. Remove the checks.
Reviewed by: jilles
Differential Revision: https://reviews.freebsd.org/D1716
|
|
|
|
|
|
|
|
|
| |
Increase the buffer size to keep the list of programm names when
parsing programm specification. It is safe to not check out of bounds
access, because !isprint(p[i]) check will stop reading, when '\0'
character will be read from the input string.
Sponsored by: Yandex LLC
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes 3 problems in syslogd related to sizing receive buffers...
- A call was misplaced at the wrong level of nested if blocks, so that
the buffers for unix domain sockets (/dev/log, /dev/klog) were never
increased at all; they remained at a way-too-small default size of 4096.
- The function that was supposed to double the size of the buffer
sometimes did nothing, and sometimes installed a wildly-wrong buffer
size (either too large or too small) due to an unitialized 'slen'
variable passed to getsockopt(). Most often it doubled the UDP buffers
from 40k to 80k because accidentally there would be harmless stack
garbage in the unitialized variables.
- The whole concept of blindly doubling a socket's buffer size without
knowing what size it started at is a design flaw that has to be called a
bug. If the double_rbuf() function had worked at all (I.E., if the
other two bugs didn't exist) this would lead to UDP sockets having an
80k buffer while unix dgram sockets get an 8k buffer. There's nothing
about the problem being solved that requires larger buffers for UDP than
for unix dgram sockets -- the buffering requirements are the same
regardless of socket type.
This change renames the double_rbuf() function to increase_rbuf() and
increases the buffer size on all types of sockets to 80k. 80k was
chosen only because it appears to be the size the original change was
shooting for, and it certainly seems to be reasonably large (I might
have picked 64k in the absence of any historical guidance).
Add ENETUNREACH and EADDRNOTAVAIL to the list of errors that are potentially
transient and shouldn't result in closing the socket and giving up forever.
|
|
|
|
|
|
|
|
|
|
|
| |
When syslogd forks a process for '|' destinations, it closes all file
descriptors greater than 2.
Use closefrom() for this instead of a getdtablesize()/close() loop because
it is both faster and avoids leaving file descriptors open because the limit
was lowered after they were opened.
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
| |
conditions.
- Don't check for AF_INET6 when compiled without INET6 support.
PR: bin/173930
Submitted by: Garrett Cooper <yanegomi@gmail.com>
Approved by: rstone (co-mentor)
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
| |
PR: bin/150530
Submitted by: andy white <andywhite@gmail.com>
Tested by: Olivier Cochard-Labbe <olivier@cochard.me>
MFC after: 1 month
|
|
|
|
|
|
|
|
| |
behavior, which binds to the well known UDP port.
This option implies -s.
MFC after: 2 months
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Checking if it is > 0 doesn't make sense, because snprintf returns
how much space is needed if the buffer is too small. Instead, check
if the return value was greater than the buffer size, and truncate
the message if it was too long.
It isn't clear if snprintf can return a negative value in the case
of an error - I don't believe it can. If it can, then testing
v->iov_len won't help 'cos it is a size_t, not an ssize_t.
Also, as clang points out, we must always increment v here, because
later code depends on the message being in iov[5].
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
standard ports, but it can't *receive* them (port 514 is
hardcoded). This commit adds that missing feature.
(NB: I actually needed this feature for a server farm where
multiple jails run with shared IP addresses, and every jail
should have its own syslogd process.)
As a side effect, syslogd now compiles with WARNS=6.
Approved by: des (mentor)
MFC after: 3 weeks
|
| |
|
|
|
|
|
| |
Because strings are guaranteed to be null terminated, there is no need
for excessive copying of strings, such as the line name.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
environments.
Please note that this can't be done while such processes run in jails.
Note: in future it would be interesting to find a way to do that
selectively for any desired proccess (choosen by user himself), probabilly
via a ptrace interface or whatever.
Obtained from: Sandvine Incorporated
Reviewed by: emaste, arch@
Sponsored by: Sandvine Incorporated
MFC: 1 month
|
|
|
|
|
| |
WARNS?=6 on amd64 but I have not tested under universe so keep WARNS?=
level as-is for now.
|
| |
|
|
|
|
| |
(more accurate extraction of Juniper Networks change)
|
|
|
|
|
|
| |
While I'm here bump WARNS to 3.
Obtained from: Juniper Networks
|
|
|
|
|
|
|
|
|
|
| |
messages from the network. We already replace malformatted timestamps
and this option lets us replace timestamps that are correctly formatted
but wrong.
PR: 120891
Submitted by: Thomas Vogt <thomas@bsdunix.ch>
MFC after: 1 week
|
| |
|
|
|
|
| |
MFC after: 2 weeks
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
1) Use [AP]F_LOCAL rather than [AP]F_UNIX.
2) When copying a pipe's name, use f->f_un.f_pipe.f_pname, not f->f_un.f_fname.
PR: 20889
Submitted by: Damieon Stark
PR: 116642
Submitted by: Jim Pirzyk
Reviewed by: md5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
for the port to drain).
+ Handle "*" as a priority properly.
+ Test what is free'ed.
+ Dynamically determine length vs. hardcoding it.
+ Free the previous message buffer (f_prevline) only after logging all the
messages and just before the process exit. Also check f_prevline for NULL
before using it.
+ The time displayed is not synchornized with the other log destinations.
+ Fix a comment.
Obtained from: Juniper Networks
|
| |
|
| |
|
|
|
|
|
| |
standard syslog port. This allows syslog to easily export lines of interest to
an external logging system.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
foo() {
}
to
foo()
{
}
|
|
|
|
| |
Pointy hat to: Jeremie Le Hen
|
|
|
|
| |
Submitted by: Jeremie Le Hen <jeremie le-hen org>
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
NI_WITHSCOPEID, and our getaddrinfo(3) does nothing special
for it, now.
|
|
|
|
|
|
|
| |
socket /var/run/logpriv.
Reviewed by: glebius and kensmith
MFC after: 2 days
|
|
|
|
|
| |
PR: bin/79260
Submitted by: Shuichi KITAGUCHI
|
|
|
|
|
|
| |
addresses and scope IDs.
MFC after: 3 weeks
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|