-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
journald sends messages to syslog even when configured not to forward them #15807
Comments
If I've tracked down why
Stopping |
StandardOutput=syslog is long obsolete, we don't document it anymore even. it enables forwarding to syslog even when journald wouldn't do that normally. Simply don#t use StandardOutput=syslog. The implied service default is StandardOutput=journal anyway, which does not suffer by this problem. |
Let's go one step further and upgrade implicitly. Usually =syslog assignments are historic artifacts only. Let's upgrade the lines automatically, and politely suggest people update their unit files/configuration. Fixes: systemd#15807
#15812 gets rid of the concept, and implicitly patches StandardOutput=syslog to mean StandardOutput=journal to avoid this issue altogether |
oops. pressed the wrong button. let's github auto-close the issue when the PR gets merged. |
Let's go one step further and upgrade implicitly. Usually =syslog assignments are historic artifacts only. Let's upgrade the lines automatically, and politely suggest people update their unit files/configuration. Fixes: systemd#15807
…lar for StandardError=) Let's go one step further and upgrade implicitly. Usually =syslog assignments are historic artifacts only. Let's upgrade the lines automatically, and politely suggest people update their unit files/configuration (and drop the lines altogether, without replacement). Fixes: systemd#15807
See systemd/systemd#15807 LTC#192095 bsc#1183700 Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Recent systemd include a warning message when StandardOutput / StandardError is set to "syslog" in a unit file [15812]. Quoting [poettering] from another PR which caused him to create this one: > StandardOutput=syslog is long obsolete, we don't document it anymore > even. it enables forwarding to syslog even when journald wouldn't do > that normally. > > Simply don#t use StandardOutput=syslog. The implied service default is > StandardOutput=journal anyway, which does not suffer by this problem. So simply remove these lines and honor the DefaultStandardOutput / DefaultStandardError if the admin set them. [15812]: systemd/systemd#15812 [poettering]: systemd/systemd#15807 (comment)
Recent systemd include a warning message when StandardOutput / StandardError is set to "syslog" in a unit file [15812]. Quoting [poettering] from another PR which caused him to create this one: > StandardOutput=syslog is long obsolete, we don't document it anymore > even. it enables forwarding to syslog even when journald wouldn't do > that normally. > > Simply don#t use StandardOutput=syslog. The implied service default is > StandardOutput=journal anyway, which does not suffer by this problem. So simply remove these lines and honor the DefaultStandardOutput / DefaultStandardError if the admin set them. [15812]: systemd/systemd#15812 [poettering]: systemd/systemd#15807 (comment)
Recent systemd include a warning message when StandardOutput / StandardError is set to "syslog" in a unit file [15812]. Quoting [poettering] from another PR which caused him to create this one: > StandardOutput=syslog is long obsolete, we don't document it anymore > even. it enables forwarding to syslog even when journald wouldn't do > that normally. > > Simply don#t use StandardOutput=syslog. The implied service default is > StandardOutput=journal anyway, which does not suffer by this problem. So simply remove these lines and honor the DefaultStandardOutput / DefaultStandardError if the admin set them. [15812]: systemd/systemd#15812 [poettering]: systemd/systemd#15807 (comment)
Recent systemd include a warning message when StandardOutput / StandardError is set to "syslog" in a unit file [15812]. Quoting [poettering] from another PR which caused him to create this one: > StandardOutput=syslog is long obsolete, we don't document it anymore > even. it enables forwarding to syslog even when journald wouldn't do > that normally. > > Simply don#t use StandardOutput=syslog. The implied service default is > StandardOutput=journal anyway, which does not suffer by this problem. So simply remove these lines and honor the DefaultStandardOutput / DefaultStandardError if the admin set them. [15812]: systemd/systemd#15812 [poettering]: systemd/systemd#15807 (comment)
systemd 249 (used in Ubuntu 22.04 LTS) throws the following error: /etc/systemd/system/stalwart-mail.service:16: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing the setting altogether. /etc/systemd/system/stalwart-mail.service:17: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing the setting altogether. This is caused by StandardOutput=syslog and StandardError=syslog found in install.sh, which are as the error suggests obsolete options that should not be used.[1] They have "correct" settings in stalwart-mail.service, but these settings are also the implicit default, which means they are not necessary.[1] This was patched in systemd #15812 in May, 2020.[2] I have tested this by simply removing the values in /etc/systemd/system/stalwart-mail.service on my server, running 'daemon-reload' and restarting the service, then confirming that logs are still being written to journalctl as well as /opt/stalwart-mail/logs [1]: <systemd/systemd#15807 (comment)> [2]: <systemd/systemd#15812>
systemd version the issue has been seen with
237 (but the code is the same in 245: https://github.com/systemd/systemd/blob/v245/src/journal/journald-stream.c#L272)
Used distribution
Ubuntu 18.04.4
Expected behaviour you didn't see
journald is configured not to forward to syslog, so it never sends messages to
/run/systemd/journal/syslog
.Unexpected behaviour you saw
If a service is configured to output to syslog, journald sends messages to
/run/systemd/journal/syslog
regardless of the configuration.Steps to reproduce the problem
ForwardToSyslog=no
/run/systemd/journal/syslog
syslog.socket
is runningEventually the socket buffer fills up and journald will complain about missing messages sent to syslog.
Most service configuration is in distribution packages so it's not practical to try and override their output settings.
The text was updated successfully, but these errors were encountered: