Web lists-archives.com

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




On 2018-04-06 18:29, Don Armstrong wrote:
> On Fri, 06 Apr 2018, Mikhail Morfikov wrote:
>> Basically, all messages returned by X-applications are redirected to the
>> ~/.xsession-errors file. 
> [...]
>> Unfortunately, the ~/.xsession-errors file grows in size, and after a
>> few hours it's around 20-30 MiB, and the content of the file isn't removed with
>> each X session restart.
> 
> I personally do this:
> 
> DATE=$(date "+%Y%m%d_%H%M%S")
> # track xsession errors
> mv ~/.xsession-errors ~/.xsession-errors_${DATE};
> ln -sf ~/.xsession-errors_${DATE} ~/.xsession-errors-current;
> # delete old xsession error files
> find ~/ -maxdepth 1 -mindepth 1 -type f \
>     -iname '.xsession-errors_*' -ctime +30 -delete;
> 
> in my .xsession.[1]
> 
>> Is it even possible to redirect the content of the file to the FIFO device in
>> this way?
> 
> The general way to do this is to do re-exec the shell with different
> output options, something like this:
> 
> exec > /dev/log-xsession-errors 2>&1;
> 
> in your .xsession [or whatever you're using to start things] after
> testing that the FIFO works.
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.
> 
> 1: https://git.donarmstrong.com/x_base.git/b/.xsession
> 


Attachment: signature.asc
Description: OpenPGP digital signature