[srslte-users] Log files are empty while process srsxxx running

Filipe Laíns lains at archlinux.org
Wed Feb 26 22:54:26 UTC 2020


On Tue, 2020-02-25 at 17:50 -0500, WILMAR ARLEY ARCILA CASTAÑO wrote:
> Hi all.
> 
> I'm trying to use the log file (let's say of the srsepc:
> /tmp/epc.log) within a bash script for testing purposes. It only make
> sense doing this while the process is running (srsepc in this
> example). However when I read the aforementioned file it appears
> empty, but when the process is stopped all the messages appear in the
> log file.
> 1. Is this behavior due to a lock on this file got for the process
> srsepc?
> 2. It's there a way to read on that file while the process srsepc is
> running?
> 
> As a way around this problem, I'm executing the process like this
> "sudo srsepc --log.filename stdout|tee /tmp/epc1.log" and reading
> from /tmp/epc1.log.
> 3. Is there another way to do what I need to do?
> 
> Thank you.
> ---
> Wilmar Arcila Castaño.
> Grupo de Investigación en Telecomunicaciones Aplicadas (GITA -  of.
> 18-310), Departamento de Ingeniería Electrónica y de
> Telecomunicaciones, Facultad de Ingeniería, Universidad de Antioquia
> UdeA, Recepción de correspondencia: Calle 70 No. 52-21, Medellin,
> Colombia.

Hi Wilmar,

From my testing this behavior appears to be correct. And it seems to me
like this is the intended behavior.

As you suggested, could use tee to redirect the output to your script
while still printing it to the screen. If you want to run your script
from another terminal you can create a fifo, which is a file descriptor
that basically works as a pipe:

$ mkfifo srsepc.log
$ ./my_script.sh srsepc.log

$ sudo srsepc --log.filename srsepc.log

Just keep in mind it won't buffer any data, it is purely a pipe.

This way you can have your bash script output something without the
interference of the srsepc output.

Cheers,
Filipe Laíns
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.srsran.com/pipermail/srsran-users/attachments/20200226/f167539f/attachment.sig>


More information about the srsran-users mailing list