Commit Graph

105 Commits

Author SHA1 Message Date
Joachim Wiberg 45d351065a Fix #37: improve accuracy of MARK timer
Instead of running the domark() timer on half the MarkInterval option,
we take the FreeBSD approach and run on each TIMERINTVL (30 sec), same
as the doflush() timer.  This allows greater resolution on the MARK log
message, meaning we would be off by < 30 seconds instead of the current
MarkInterval / 2.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-07-26 09:14:33 +02:00
Joachim Wiberg f926039511 Update copyright years
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-30 20:06:33 +02:00
Joachim Wiberg 218a032557 Fix #61: add support for `-c` and `-cc` to disable log compression
This patch imports the FreeBSD meaning to the `-c` command line option.
It disables "last message repeated" style log compression for repeated
log messages.  A single `-c` disables compression for pipes, another
`-c` (-cc works) also disables compression for all other log targets.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-04-22 08:48:32 +02:00
Joachim Wiberg 153e6c4b65 Fix #60: document how to set side-wide permissions on log files
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-12-08 23:44:40 +01:00
Joachim Wiberg 7bd017be0a logger: fix default log severity info -> notice, like other loggers
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-08-01 12:48:31 +02:00
Joachim Wiberg 51ecc21973 man: update syslogp.3 with latest changes for remote logging
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-08-01 11:34:55 +02:00
Joachim Wiberg 460e26f0f2 man: update change date and copyright years on logger.1
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-08-01 11:34:55 +02:00
Joachim Wiberg c095131ff9 man: update logger(1), it can log to remote servers now
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-07-31 17:32:13 +02:00
Joachim Wiberg 4f94756bf2 logger: add support for -I PID to log, e.g., $$ from a shell script
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-07-31 12:03:57 +02:00
Joachim Wiberg f32ca837c1 logger: add support for -H NAME to override system hostname
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-07-31 11:48:58 +02:00
Joachim Wiberg ea1762d5f5 man: update logger(1) with new options for remote logging and format
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-07-31 10:46:32 +02:00
Joachim Wiberg 075815eeb8 Add support for setting secure_mode=[0,1,2] in .conf file
Logic for secure mode setting in .conf file

 - Command line always wins
 - SIGHUP activates changes

Note, if -s is given on command line it always wins, regardless.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-05-22 22:10:12 +02:00
Steffen Nurpmeso 949e80f150 Implement forced log file rotation upon SIGUSR2 2022-03-14 05:52:46 +01:00
Steffen Nurpmeso 72f2faef6e Add "notify" keyword 2022-03-12 15:28:02 +01:00
Joachim Wiberg 6022d3c7d0 Fix #49: add support for -8 command line option to allow 8-bit data
This patch allows the user to disable the 8-bit data check in the log
message validator.  If you have experienced problems with logging any
unicode (utf-8) messages after v1.6, this option is for you.

The correct way to handle this is to add proper parser support for the
Unicode BOM, defined in RFC5424[1], as NetBSD syslogd does[2], search
for IS_BOM().

[1]: https://datatracker.ietf.org/doc/html/rfc5424#appendix-A.8
[2]: http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.sbin/syslogd/syslogd.c?rev=1.138

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-03-07 20:57:00 +01:00
Joachim Wiberg 7707715c78 man: update '-b' option description to match '-a' and usage text
The usage text (syslogd -?) and the syslogd.8 man page was not in sync
wrt. the -b option.  This patch updates it to match the layout of -a,
the -a option is also slightly updated.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-03-06 00:49:25 +01:00
Joachim Wiberg 29e932008d Fix #48: add option ('-K') to disable kernel logging
This patch adds support for disabling kernel logging, opensys().  This
is in addition to the character device validation check, and primarily
for use in container use-cases -- where logging kernel is not needed.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-02-13 23:40:06 +01:00
Joachim Wiberg e61e5abb88 Follow-up to 9856e07, rename '-K' option to '-t'
We need the '-K' option to disable kernel logging, so this option needs
to be renamed, unfortunately.  Fortunately it's not been released yet.

Issue #42

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-02-13 22:53:02 +01:00
Loebl 32f5a98efe Fix log rotation option reference 2021-12-21 16:32:20 +01:00
Joachim Wiberg 9856e07e40 Fix #42: add option to always trust kernel timestamp
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-11-26 06:50:31 +01:00
Joachim Wiberg 17a62a7f31 Fix #41: add missing documentation for -H option
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-11-09 18:32:49 +01:00
Joachim Wiberg b0d4e4cc3f Fix #40: update docs and online help text wrt. caching of kmsg seqno
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-07-26 14:04:45 +02:00
Joachim Wiberg e381bc3620 Fix #38: add option `-C file` for alt. kernel seqno cache file
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-30 22:39:09 +02:00
Joachim Wiberg 287e009514 Fix #35: syslogd man page lists -v as verbose mode, is version
When syncing with the FreeBSD man page the audit missed this option.
The man page should detail what the daemon does, even though in this
case it would've been nice to have the FreeBSD behahvior for -v.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-22 08:24:43 +02:00
Joachim Wiberg 82b7e2bfcb man: update logger.1 with info on new -k option
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-21 23:12:54 +02:00
Joachim Wiberg 4e1aefaf3d man: update syslogd(8) with new cache file and fix pidfile name
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-05-05 05:17:15 +02:00
Joachim Wiberg 9dba6d3b9f man: fix unexpected use of .Lb, found by lintian
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-21 15:50:13 +01:00
Joachim Wiberg c66c36fa90 man: drop sysklogd version from .Os and fix syslog.conf .Nd
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-21 15:50:13 +01:00
Joachim Wiberg a26ec5a84e man: Fix spelling error found by lintian
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-21 15:50:13 +01:00
Joachim Wiberg 45085709e8 Update copyright years
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-01-15 11:16:04 +01:00
Joachim Wiberg 30842595d5 Update copyright years and author last name
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2020-08-31 21:28:45 +02:00
Joachim Wiberg 5aa7372f4c Fix #19: Prefer /dev/kmsg over /proc/kmsg on Linux
This patch migrates the sysklogd project to use the modern /dev/kmsg
interface on Linux.  There are many advantages over the older /proc
interface; 1) no need to wait for /proc to be mounted, 2) it provides
multiple simultaneous access.  For more information, see:

  https://www.kernel.org/doc/Documentation/ABI/testing/dev-kmsg

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2020-08-31 21:28:45 +02:00
Joachim Nilsson 84f8e51541 man: Add Emacs nroff hinting to all man pages
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-12-09 18:29:59 +01:00
Joachim Nilsson 864ddaeb7d man: Change formatting of log msg examples using Li instead of Cm
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-12-09 18:29:14 +01:00
Joachim Nilsson 06f669f32e man: Try Li instead of Ql, possibly better in HTML rendition
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-12-09 18:24:23 +01:00
Joachim Nilsson af37f47f91 man: Add more whitespace to HISTORY to make it more readable
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-12-09 18:20:28 +01:00
Joachim Nilsson dca20067c6 man: Try Ql for inline literal display rather than Cm
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-12-09 18:20:03 +01:00
Joachim Nilsson 7abb1b9137 man: Use .Os to detail project name and version
Also, by convention .Dt should always be in upper case.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-12-09 17:32:46 +01:00
Joachim Nilsson 08b6c6fd0f man: Sync FreeBSD syslog.conf.5 man page w/ limitations in sysklogd
The FreeBSD syslogd has more priority matching features and can also
group rules per program/hostname logging.  The sysklogd project does
not yet support this, so that is removed and instead the syntax and
examples are better described.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-12-09 13:22:46 +01:00
Joachim Nilsson 881fd52acc man: Sync FreeBSD syslogd man page with the realities of the project
Add missing -r option for log rotation and remove -8 option, which we
don't have yet.

Add SECURITY, DEBUGGING, and SIGNALS sections and expand upon the BUGS
section a bit to link things together.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-12-09 13:22:46 +01:00
Joachim Nilsson 1d5c71c6d9 man: Adapt FreeBSD syslogd.8 to the flags and history of sysklogd
- Much less command line options (for now)
- Mention support for RFC3164 and RFC5424
- Add the history of the sysklogd project

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-12-07 12:36:14 +01:00
Joachim Nilsson 899d0d28be Relicense configure.ac and Makefile.am's under 3-clause BSD
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-12-07 10:57:47 +01:00
Joachim Nilsson 17cf953b97 Import pristine FreeBSD versions of man pages for license change
This patch replaces the original man pages by Greg and Martin, that were
both licensed under the GNU GPL, with 3-clause BSD licensed versions of
the same man pages from FreeBSD.

- syslogd.8     FreeBSD Subversion r335862
- syslog.conf.5 FreeBSD Subversion r314436

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-12-07 10:49:36 +01:00
Joachim Nilsson fd2721598b Update version information and change date for man pages
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-12-07 10:31:06 +01:00
Joachim Nilsson 6bb6672ebf Remove klogd from the sysklogd project
This patch removes one of the traditionally key pieces of the sysklogd
project, klogd.  Now that syslogd performs logging of kernel messages
we no longer require a separate daemon for that.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-12-07 10:31:06 +01:00
Joachim Nilsson 3f94ae2906 man: Fix formatting of `interval / 2`
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-12-06 18:15:04 +01:00
Joachim Nilsson 163aa84cc4 klogd: Add '-F' as alias for '-n', for compat with syslogd
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-12-01 21:17:02 +01:00
Joachim Nilsson 4556901a2b syslogd: Update documentation, -m interval is in minutes
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-12-01 15:59:35 +01:00
Lars Wendler 227008ec0f
build: make logger and its man page optional
There are other packages that provide a logger program like util-linux
We should respekt that

Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
2019-11-18 12:36:25 +01:00
Joachim Nilsson ac8b8ebf0d klogd.8: Remove wording on role and superiority over syslogd
For most use-cases a kernel with CONFIG_KALLSYMS and a stand-alone
syslogd is sufficient.  No need for the complexity of klogd.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-15 09:59:18 +01:00