Skip to content
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

Get rid of StandardOutput=syslog #15812

Merged
merged 2 commits into from
May 15, 2020

Conversation

poettering
Copy link
Member

It's confusing and mostly a historic artifact. let's patch to StandardOutput=journal automatically, and log about it.

Fixes: #15807

@mbiebl
Copy link
Contributor

mbiebl commented May 14, 2020

http://codesearch.debian.net/search?q=StandardOutput%3Dsyslog&literal=1
Its usage seems to be quite wide spread. I wonder why that is?

@mbiebl
Copy link
Contributor

mbiebl commented May 14, 2020

Does this also affect StandardError=?

@poettering
Copy link
Member Author

i think early howtos suggested that.

yes, it applies to both the stdout and the stderr stuff

Copy link
Member

@keszybz keszybz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice. My only gripe is that if codesearch shows 8 pages of packages using this, we shouldn't make this a warning. Esp. that it really doesn't matter much. We autocorrect this, so info (or at most notice), seems totally appropriate.

src/core/load-fragment.c Outdated Show resolved Hide resolved
@poettering poettering added good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed and removed good-to-merge/with-minor-suggestions labels May 14, 2020
@poettering
Copy link
Member Author

force pushed new version. Only change is the LOG_NOTICE change. Took liberty to upgrade green label.

@mbiebl
Copy link
Contributor

mbiebl commented May 14, 2020

Could you update the commit message to mention StandardError=?

I guess we could add a lintian check in Debian which checks for this.
What would be the recommended action to resolve this?
Drop StandardOutput/StandardError or replace it? Something else?

Would be great if there was a recommendation what should be used instead.

@poettering
Copy link
Member Author

Would be great if there was a recommendation what should be used instead.

The log message makes a suggestion already: "Please update your unit file, and consider removing the setting altogether."

That should be enough, no?

We dropped them from the StandardOuput= documentation long ago, but
elswhere some references where lurking.
…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
@poettering
Copy link
Member Author

added this StandardError= thing to the commit msg

@mbiebl
Copy link
Contributor

mbiebl commented May 14, 2020

Would be great if there was a recommendation what should be used instead.

The log message makes a suggestion already: "Please update your unit file, and consider removing the setting altogether."

That should be enough, no?

Yes, thanks.
I'll try to get lintian updated accordingly and issue a warning.

@keszybz
Copy link
Member

keszybz commented May 15, 2020

bionic-i386 timed out.

@keszybz keszybz added ci-failure-appears-unrelated and removed good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed labels May 15, 2020
@keszybz keszybz merged commit f5b0455 into systemd:master May 15, 2020
smortex added a commit to smortex/go-choria that referenced this pull request Sep 2, 2021
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)
smortex added a commit to smortex/go-choria that referenced this pull request Sep 2, 2021
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)
smortex added a commit to smortex/go-choria that referenced this pull request Sep 2, 2021
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)
smortex added a commit to smortex/go-choria that referenced this pull request Sep 2, 2021
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)
menonsudhir added a commit to menonsudhir/freeipa that referenced this pull request Nov 21, 2022
This patch updates the deprecated syslog setting i.e
StandardError=syslog with StandardError=journal

Pagure: https://pagure.io/freeipa/issue/9279
Ref: systemd/systemd#15812

Signed-off-by: Sudhir Menon <sumenon@redhat.com>
abbra pushed a commit to freeipa/freeipa that referenced this pull request Dec 19, 2022
This patch updates the deprecated syslog setting i.e
StandardError=syslog with StandardError=journal

Pagure: https://pagure.io/freeipa/issue/9279
Ref: systemd/systemd#15812

Signed-off-by: Sudhir Menon <sumenon@redhat.com>
Reviewed-By: Peter Keresztes Schmidt <carbenium@outlook.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
flo-renaud pushed a commit to flo-renaud/freeipa that referenced this pull request Dec 19, 2022
This patch updates the deprecated syslog setting i.e
StandardError=syslog with StandardError=journal

Pagure: https://pagure.io/freeipa/issue/9279
Ref: systemd/systemd#15812

Signed-off-by: Sudhir Menon <sumenon@redhat.com>
flo-renaud pushed a commit to flo-renaud/freeipa that referenced this pull request Dec 19, 2022
This patch updates the deprecated syslog setting i.e
StandardError=syslog with StandardError=journal

Pagure: https://pagure.io/freeipa/issue/9279
Ref: systemd/systemd#15812

Signed-off-by: Sudhir Menon <sumenon@redhat.com>
abbra pushed a commit to freeipa/freeipa that referenced this pull request Dec 19, 2022
This patch updates the deprecated syslog setting i.e
StandardError=syslog with StandardError=journal

Pagure: https://pagure.io/freeipa/issue/9279
Ref: systemd/systemd#15812

Signed-off-by: Sudhir Menon <sumenon@redhat.com>
Reviewed-By: Peter Keresztes Schmidt <carbenium@outlook.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
abbra pushed a commit to freeipa/freeipa that referenced this pull request Dec 19, 2022
This patch updates the deprecated syslog setting i.e
StandardError=syslog with StandardError=journal

Pagure: https://pagure.io/freeipa/issue/9279
Ref: systemd/systemd#15812

Signed-off-by: Sudhir Menon <sumenon@redhat.com>
Reviewed-By: Peter Keresztes Schmidt <carbenium@outlook.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
mdecimus pushed a commit to stalwartlabs/mail-server that referenced this pull request May 5, 2024
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

journald sends messages to syslog even when configured not to forward them
3 participants