Bug 1319641 - systemctl prints notifications on stderr
Summary: systemctl prints notifications on stderr
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-21 09:03 UTC by Filip Kroupa
Modified: 2016-04-15 06:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-15 06:11:25 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Filip Kroupa 2016-03-21 09:03:34 UTC
Description of problem:
Enabling service using 'systemctl enable <servicename>' yields confirmation message "Created symlink from <location1> to <location2>". This confirmation message is not printed on stdout, but on stderr. This is a problem since it creates unwanted output on stderr if 'systemctl enable <servicename>' is part of service installation script.


How reproducible:
It is always reproducible


Steps to Reproduce:
(service being enabled must be previously disabled to see the confirmation message 'systemctl disable <service name>')
1. run 'systemctl enable <service name> 1>/dev/null'
2. prints "Created symlink from <location1> to <location2>" => it's printed on stderr

(service being enabled must be previously disabled to see the confirmation message 'systemctl disable <service name>')
1. run 'systemctl enable <service name> 2>/dev/null'
2. prints nothing => message was on stderr


Expected results:
I expect the confirmation to be printed on stdout

Comment 2 Lukáš Nykrýn 2016-03-21 12:01:58 UTC
--quiet ?

Comment 3 Filip Kroupa 2016-03-21 12:24:22 UTC
(In reply to Lukáš Nykrýn from comment #2)
> --quiet ?

Well that's not the point. I'm not asking how to hide the output. I'm trying to point out that this particular message should be printed on standard output and it pollutes error output.
Anyway I would not be able to pass any arguments to the systemctl command, I'm in no conrol of the script which calls it. All I do is process the stdout and stderr.

Comment 4 Lukáš Nykrýn 2016-04-15 06:11:25 UTC
I would say that this is correct behavior, the output is more a status message and it should not be process by a pipe with some additional program.

If you really think that this behavior should change, please file an upstream issue github.com/systemd/systemd/issues.


Note You need to log in before you can comment on or make changes to this bug.