[systemd-devel] Outputting STDOUT and STDERR to current $SSH_TTY

Sergei Franco sergei.franco at gmail.com
Mon Aug 14 10:31:23 UTC 2017


Admins expect output when starting and stopping services.
This is even more important when there are runbooks and other processes
involved.
The journalctl output is very messy (because it is a log). When you are on
call and you have to deal with an issue at 3am in the morning, the messy
output adds to the already high cognitive load.
As system engineers we used to be able write our own init scripts that
would leave colourized and concise messages about particular sub-services
of a service.
This would make it easy for admin on call to determine if everything OK or
not.

What is even more annoying when start up fails, it just tells you that it
failed and for more info to see the status or journalctl. Would it not be
more logical dump the standard error into current tty and status instead of
pointless message?

There needs to be a setting to pass through stdout and error to whatever
the tty is used to invoke the systemctl.

Warning: rant follows!

I am yet to see a systems engineer that praised systemd. All I hear from my
colleagues is swearing when they deal with systemd. What makes them angry?
Inability to actually see what is going on. Has mysql actually failed to
start or is it repairing tables after a crash? Who knows, systemd ate the
output. Is the firewall script actually doing what is supposed to do or
not, who knows, there is no way to pass that information directly without
systemd hiding it. The only way to catch errors with bash scripts is using
"set -e" (there is no eye balling it), which means even partial
functionality now is a failure.

Even simple things like where is the bloody unit defined, is it in
/etc/systemd/system/ or /lib/systemd/system/ or is it in
/usr/lib/systemd/system/?. What about tail -f 1000 /var/log/messages | grep
bla | awk .. Can't really do that any more, as journalctl does not support
number of lines to follow from (and again, I could be wrong here, I have
been wrong many times).

Why /lib/ for essentially config files? Isn't what /etc/ is for?

Then we have the whole "predictable" interface naming scheme, with names
like enp35s0f1. Very "predictable" (they change!) and very "easy" to type
in middle of night.

I would take simplicity over boot up times any day. How often do you think
we reboot our servers? I have no problem with actual unit definitions and
what systemd as init system trying to do.
I have a problem with binary logs that simply discard all information after
the corruption (right where fiber channel dropped couple of packets and you
needed to see those IO erros).
I have a problem where dhcp clients, ntp and resolvers are being reinvented
for sake of it (and with whole bunch of new security holes).

What happen to do one thing and do it well philosophy?

Regards.

Sergei.

On 14 August 2017 at 21:20, Zhujiafa <zhujiafa at huawei.com> wrote:

> "  With systemd all output is "hidden",  "
>
>          He just wanted to see more detailed boot messages
>          too determine the xxxx.service is correct !
> ========================
> ZhuJiafa
> email: zhujiafa at huawei.com
> tel: +86 18651652661 <+86%20186%205165%202661>
>
>
> *From:* vcaputo at pengaru.com
> *Date:* 2017-08-12 02:57
> *To:* Zhujiafa <zhujiafa at huawei.com>
> *CC:* Reindl Harald <h.reindl at thelounge.net>; systemd-devel at lists.
> freedesktop.org
> *Subject:* Re: [systemd-devel] Outputting STDOUT and STDERR to current
> $SSH_TTY
>
> This is not recommended.  Forwarding is currently implemented
> synchronously in journald, and can have a very substantial negative
> impact on journald performance in general as a result.
>
> BTW: are we not averse to top-posting on systemd-devel?
>
> Regards,
> Vito Caputo
>
>
> On Fri, Aug 11, 2017 at 05:47:15AM +0000, Zhujiafa wrote:
> > add
> > " systemd.journald.forward_to_console=1 "
> >  to your kernel  parameters.
> >
> >
> > ________________________________
> > ========================
> > ZhuJiafa
> > email: zhujiafa at huawei.com<mailto:zhujiafa at huawei.com
> <zhujiafa at huawei.com>>
> > tel: +86 18651652661 <+86%20186%205165%202661>
> >
> > From: Reindl Harald<mailto:h.reindl at thelounge.net
> <h.reindl at thelounge.net>>
> > Date: 2017-08-11 13:37
> > To: systemd-devel at lists.freedesktop.org<mailto:systemd-devel at lists.
> freedesktop.org <systemd-devel at lists.freedesktop.org>>
> > Subject: Re: [systemd-devel] Outputting STDOUT and STDERR to current
> $SSH_TTY
> >
> >
> >
> > Am 11.08.2017 um 04:29 schrieb Sergei Franco:
> > > I am trying to retain behaviour of the startup scripts the same as
> sysvinit.
> > > For example, on sysv the script outputs feedback to the console when
> the
> > > stopping and starting is done via console.
> > > With systemd all output is "hidden", and to see the output you need to
> > > check the journal (or syslog if configured). There is no feedback.
> > >
> > > Is it possible to configure StandardOutput=tty (and StandardErrror)
> > > where TTYPath= is set to current $SSH_TTY env (be that
> > > /devpts/0,/dev/pts/1 or /dev/pts/n)?
> >
> > no, because PID1 is a completly different process than any TTY
> > _______________________________________________
> > systemd-devel mailing list
> > systemd-devel at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
> > _______________________________________________
> > systemd-devel mailing list
> > systemd-devel at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20170814/8f1f9574/attachment-0001.html>


More information about the systemd-devel mailing list