Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Thank you. Can I pipe or redirect my way out of this, short of programmatic fixes? Commented Jun 24, 2021 at 21:57
  • 1
    @seamux See edited answer Commented Jun 25, 2021 at 0:00
  • 1
    With file:/run/event_monitor_ctl, that would cause systemd to hang on the open() of that file unless you can convince systemd to open it with O_RDWR. It may be preferable to use a wrapper script that starts event_monitor <> fifo or if on Linux (and sh is not ksh93) just run sh -c ':|event_monitor<>/dev/fd/0' Commented Jun 25, 2021 at 7:16
  • @StéphaneChazelas wow, that worked, simple as that, just by changing stdbuf -oL /usr/bin/event_monitor | while ... to stdbuf -oL sh -c ':|/usr/bin/event_monitor <> /dev/fd/0' | while .... Could you please post this as the answer and perhaps explain how it works? I had been trying wrapping it in bash with 0>&2 </dev/stdin to no avail (works fine as a script even with </dev/null prepended, but exits right away as a service). Commented Jun 25, 2021 at 9:50