Sunday, November 14, 2021

[SOLVED] Starting fifo at the startup Linux fedora

Issue

I have been using fifos for controlling mpg123 player, there every-time I need to execute these 3 commands

mkfifo a // create fifo
cat > a & //to run it indefinately
mypid=$! //assign some dummy pid

I want to put this into some script which would execute it at the boot, i wrote a script containing these commands. but it was not working, after some search i got i had to execute it like

. test.sh

manually i can execute it like the above way but automatically how to execute i am struggling.?

EDITED
test.sh
cd /root/work/

now executing this as ./test.sh will not change directory on terminal as it is executed in child process, and executing it as . test.sh will change the directory to /root/work.
I want to execute it as . test.sh through some function/script or anything that i can put at startup and at every boot it runs


Solution

Since mpg123 they are providing feature for fifo control of the player

instead of executing all the commands mentioned above

just
mpg123 -R --fifo /usr/test/FIFO_NAME

and then send the command to FIFO and it's done.



Answered By - Kalu DADA