Web lists-archives.com

Re: How to redirect messages in ~/.xsession-errors to a FIFO device?




On 2018-04-06 18:56, Greg Wooledge wrote:
> On Fri, Apr 06, 2018 at 06:45:20PM +0200, Mikhail Morfikov wrote:
>> Basically even the standard "exec ..." in the /etc/X11/Xsession file (with
>> changed $ERRFILE) works fine, but I have to "cat" the FIFO device first (without
>> using systemd). The same with your exec command -- there's no difference in working.
> 
> Opening one end of a FIFO blocks until the OTHER end is also opened.
> This is why the first process to open the FIFO should be launched in
> the background (it is going to block), if both ends are coming from the
> same parent script.
> 
I just realized that.

I have some other FIFO devices that rsyslog uses, and based on that I thought
rsyslog just sends messages to the FIFO devices because it was working just fine
(without any additional steps, except creating the FIFO device), but it turns
out that rsyslog has its own queues that buffer the messages, and when I "cat"
the FIFO devices later on, rsyslog sends what's in the queues and I get the
output in the desktop terminal.

The same with systemd FIFO sockets -- they also have queues to buffer messages,
and they pass them when I "cat" the FIFO device.

So that's basically the difference between rsyslog/systemd sockets and manually
created FIFO devices, and now I get why this didn't work OOTB, and why it won't
work without some additional steps. :)

> I'm assuming that when you speak of "cat" you mean a process that opens
> the FIFO for reading.
> 
Yes.

Attachment: signature.asc
Description: OpenPGP digital signature