- Set O_CLOEXEC to the signal pipe and /dev/klog.
- Use a single signal handler to catch both SIGHUP and SIGCHLD.
- Fix a bug which did FD_SET() the writer-end of the pipe.
the main I/O multiplex loop. select() now watches
a pipe which is written by the new skinny signal
handlers and the received signals are handled inside
the loop sequencially.
This eliminates a complex signal mask to guarantee
async-signal safety.
Don't close all file descriptors greater than STDERR_FILENO (2) in
waitdaemon(..) -- only close fd (file descriptor for /dev/null used in
subsequent calls to dup2) if it's greater than STDERR_FILENO.
Reported by: subbsd@gmail.com, danny@cs.huji.ac.il
Pointyhat to: hrs
X-MFC with: r310494
sending SIGTERM to the process failed. It is an
unusual situation but it can happen.
- Split deadq_remove() into deadq_remove() and
deadq_removebypid().
- Normalize variable names of struct deadq_entry *.
now processed in struct socklist in a consistent manner.
- Add helper functions to add a new entry of struct socklist, filed, or peer.
- Use the same routine for -l, -p, and -S.
- Close /dev/klog when read(2) failed.
now maintained in a single linked-list in a transport-independent manner.
- Use queue.h for linked-list structure.
- Use linked-list for AllowedPeers.
- Use getaddrinfo(8) even for Unix Domain sockets.
- Use macros to type-casting from/to struct sockaddr{,_in,_in6}.
- Define fu_* macro for union f_un to shorten the member names.
- Remove an extra #include <sys/type.h>.
- Add "static" to non-exported symbols.
- !INET support is still incomplete but will be fixed later.
There is no functional change except for some minor debug messages.
now maintained in a single linked-list in a transport-independent manner.
- Use queue.h for linked-list structure.
- Use linked-list for AllowedPeers.
- Use getaddrinfo(8) even for Unix Domain sockets.
- Use macros to type-casting from/to struct sockaddr{,_in,_in6}.
- Define fu_* macro for union f_un to shorten the member names.
- Remove an extra #include <sys/type.h>.
- Add "static" to non-exported symbols.
- !INET support is still incomplete but will be fixed later.
There is no functional change except for some minor debug messages.
All the '.conf' files not beginning with a '.' contained int he directory
following the keyword will be included.
This keyword can only be used in the first level configuration files.
Modify the default syslogd.conf to 'include' /etc/syslog.d and
/usr/local/etc/syslog.d
It simplify a lot handling of syslog from automation tools.
Reviewed by: markj, kib (via irc)
Approved by: markj
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D8402
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.
Reviewed by: rpaulo
MFC after: 32 days
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D4475
This will help ensure we don't trash file descriptors that get used later on
in the daemon
Found via internal Coverity scan
MFC after: 2 weeks
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
syslogd already re-reads the configuration file and the hostname when
receiving a SIGHUP, so it makes sense to reset the timezone.
Special care was taken to ensure we don't break installations running
with a custom TZ variable.
PR: 196905
Submitted by: Kurt Lidl <lidl pix.net>
Sponsored by: Pi-Coral, Inc.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.
Still need to add real targets under targets/ to build packages.
Differential Revision: D2796
Reviewed by: brooks imp
foreground.
This allows a separate process to monitor when and how
syslogd exits. That process can then restart syslogd if needed.
Differential Revision: https://reviews.freebsd.org/D1985
Submitted by: Ravi Pokala
Reviewed by: allanjude (man page)
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.
MFC after: 3 weeks
Sponsored by: Nuxi
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
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D1716
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.
Obtained from: Yandex LLC
MFC after: 1 week
Sponsored by: Yandex LLC