[systemd-devel] systemd-run: why is output buffered now?

Lennart Poettering lennart at poettering.net
Fri Apr 1 19:40:17 UTC 2016


On Sun, 20.03.16 14:22, Reindl Harald (h.reindl at thelounge.net) wrote:

> please take a look at https://bugzilla.redhat.com/show_bug.cgi?id=1319475 -
> this is a unlucky behavior change, not only for usability but for scripts
> with heavy output it's also a memory usage problem

Are you sure it's not PHP that buffers things in this case?

If you use systemd-run "-t" we allocate a pty and copy each byte we
get on it directly onto the invoking terminal. There's no buffering
applied on our side really, and everything is fully async.

It would be good if you could add a "sleep 60" to your PHP
script. Then invoke your systemd-run command line with "strace
-f". That should show you what systemd-run does while the PHP script
is running, and how the data flows. If it does exactly nothing during
those 60s and you see no data flowing at all then it's PHP that's not
sending us the data. However if you see data flowing into systemd-run
with strace, but not out of it, then it would be a bug in systemd-run.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list