Questions tagged [fifo]
Questions about FIFO - first-in first-out special file, also known named pipe
46
questions with no upvoted or accepted answers
5
votes
1
answer
1k
views
Don't wait for audio stream with ffmpeg/avconv using named pipes
I have two named pipes, audio_conv and video, for s16le and h264 streams, respectively. I want to convert them to webm format on fly. Data to these pipes proceeds from my application, that parses ...
4
votes
0
answers
1k
views
Looking at the kernel logs to see if there is something wrong with my machine
My ubuntu machine slowed down, I was following these instructions:
https://askubuntu.com/questions/21632/slow-response-and-system-lag
the slowness I see is pretty uniform, and there's definitely a ...
4
votes
0
answers
811
views
two piped commands, each needs to read password from stdin
Is there a way to sensibly do this:
scp user@host:/path/to/file /dev/tty | openssl [options] | less
without creating a file, and without having to supply either password directly in arguments?
The ...
3
votes
0
answers
653
views
How to pipe all output streams to another process?
Take the following Bash script 3-output-writer.sh:
echo A >&1
echo B >&2
echo C >&3
Of course when ran as . 3-output-writer.sh it gets the error 3: Bad file descriptor, because ...
3
votes
0
answers
259
views
Combine mkfifo and cp --reflink to append files without copying data
I have huge files {0..9}.bin which I want concatenate into out.bin. I don't need the original files afterwards. So I was wondering, if this is possible by only modifying the filesystem index without ...
3
votes
0
answers
1k
views
Write to stdin of running process on occasion
From time to time I want to send some text to the input of netcat. Netcat will send it then to another netcat process (either on my machine or a local network), but now I am only concerned with the ...
3
votes
0
answers
624
views
Write to a named pipe interactively
I want to use a named pipe as input for a command line utility I'm writing. I know I can echo "all work and no play" > ./namedpipe to write once to the named pipe, but is there a way to do that ...
3
votes
1
answer
1k
views
How to grab mplayer output to file?
I need something like this:
When I'll redirect command by FIFO to mplayer echo "get_property volume" > /tmp/fifo I want to have this command output in output.txt, e.g ANS_volume=100.
I have ...
3
votes
2
answers
3k
views
How to write something to named pipe even if there are no readers
I have this little test script:
rm fooo | cat
mkfifo fooo
echo 'bar' > fooo # blocks here
echo 'done'
I am guessing that because there is nobody reading from the named pipe, that the write call ...
2
votes
0
answers
197
views
FIFO and simple bash parallelization on CentOS
I am having problems adapting a bash script to handle a simple parallel execution from Ubuntu 20.04 to CentOS Linux 8.
In the script I spawn multiple "readers" that read a string from a FIFO ...
2
votes
1
answer
126
views
Pipes and graphics
When developing a program (in C or Python, say), I often write debug messages to see whether my program behaves as intended. On Linux, such text messages can be handled in varied and flexible ways ...
2
votes
1
answer
121
views
Multiple Tracing Events Readers
Question
Does the tracing pipes in Linux, for tracing events, accepts simultaneous readers?
Context
I am trying to get traces from the RAS subsystem while running some benchmarks.
This subsystem ...
2
votes
0
answers
114
views
How to trigger a command after named pipe closes?
How can I execute some command after the named pipe has been readout in other end. I was trying to use trap. But nothing happens. My script is something like below.
#!/bin/sh
cleanup()
{
echo "...
2
votes
0
answers
195
views
Knowing when bash is done running a command through a FIFO pipe
I'm trying to link a web-based terminal with bash.
My current attempt to do so is spawning a shell pointing a FIFO pipe to its input, like this:
Terminal 1
$ mkfifo pipe
$ bash <> pipe
file1 ...
1
vote
1
answer
64
views
Allow a sudo sub process to update Zenity running as original user
A script run by user 'staffer' runs zenity --progress.
It then calls sudo -u adminBod adminScript (and the STDOUT and STDERR are collected to logger)
I want adminScript which is running as adminBod to ...
1
vote
0
answers
825
views
Write firmware over /dev/ttyUSB0 to embedded device
I'm using the last example in: this post
I keep getting wctx:file length=0 after the sz command. I'm actually opening the serial connection with minicom Minicom is botching the transfer. So, after I ...
1
vote
0
answers
106
views
bash script to lazy tar to fifo as files arrive
Here's the hypothetical scenario: I have an archival process where files are showing up and I append them to tar, and then the tar gets zipped. Something like this:
while sleep 1 ; do
new_files=&...
1
vote
1
answer
1k
views
The memory dump of a process by using GDB inside a bash script - errors, problems
I want to dump some program's memory segment to a file. Because the working time of my program is milliseconds, I use named pipe to stop its execution and dump its memory content by gdb meanwhile. The ...
1
vote
0
answers
203
views
Is it possible to have SSH display an "active" banner, by running a script to generate the banner each time, rather than read a static file
The sshd_config banner directive reads a file, but I want it to run a script, and ideally personalize the banner to the user... is this possible with ssh, or is there a way I can create a device file ...
1
vote
2
answers
205
views
How to read server stdout and continue only after message is outputted
Say I have a simple Node.js server like:
const http = require('http');
const server = http.createServer((req,res) => res.end('foobar'))
server.listen(3000, () => {
console.log(JSON....
1
vote
0
answers
188
views
Piping two audio FIFOs simultaneously, where one may not have data but takes priority, into a single FIFO output
I have a snapcast audio server, which is configured to have three audio streams (fifos): music, broadcast, and output. My speakers play the audio from the output stream, and my music players pipe ...
1
vote
0
answers
75
views
How can I create a function that memoizes other commands?
I have created the following function to memoize any command:
# zsh
(( $+functions[ec] )) || {
ec() print -r -- "$@"
ecerr() { ec "$@" 1>&2 }
ecdbg() ecerr "$@"
gq() { ec "${(q+...
1
vote
0
answers
514
views
Retaining data in a named pipe after an incomplete read access
Prerequisites:
$ mkfifo pipe1
If several lines are put into pipe1
$ (echo line 1; echo line 2) > pipe1
all the lines can be read in another terminal by
$ cat pipe1
line 1
line 2
So far all right....
1
vote
1
answer
1k
views
strace for troubleshooting inter process communication
I have output captured by following command:
strace -f -e trace=process,socketpair,open,close,dup,dup2,read,write -o rsync.log rsync -avcz --progress src/ dst/
it is a bit long so I've uploaded it ...
1
vote
0
answers
1k
views
On-the-fly decompression
I have 44 TB worth of gzipped files that are 1.5 GB each when compressed or 2.0 GB when uncompressed. I have a tool that can read only uncompressed files. I would like to avoid the overhead of ...
1
vote
0
answers
862
views
Correct/Efficient/Reliable way to import log file entries to a MySQL database?
I'd like to be able to query our server access log files to identify abuse patterns. Log files really aren't very queryable, and it would be fairly easy to do what I wanted if each hit was a row in a ...
1
vote
0
answers
861
views
'nc' using ~100% CPU when transferring a FIFO file
On the server which is always connected I’m using this in a crontab:
@reboot nc -k -l 1337 < /tmp/fifo.fifo
On the client which is not always on the network or switched on I’m using this command:
...
1
vote
0
answers
772
views
Can rsyslogd write to more than one named pipe
If I have the following two lines in the rsyslogd.conf
*.* |/var/run/rsyslog/pipe1
*.* |/var/run/rsyslog/pipe2
Will all messages be sent to both pipes? I have two programs that want to inspect lines ...
0
votes
0
answers
34
views
Strange incongruent output for both nc and fifo
I have this exact code:
#!/bin/bash
gtimeout(){
if type -f gtimeout &> /dev/null; then
command gtimeout "$@"
else
timeout "$@"
fi
}
export -f gtimeout;
...
0
votes
0
answers
11
views
Simulating control characters such as "H key" , "UP arrow key" , etc
I have a Device 1 which has debian OS installed on it. I access the serial console of it through other device i.e. Device 2 . I have scripts on the device 2 which will uninstall and install different ...
0
votes
0
answers
49
views
Simultaneous input from fifo and terminal in bash
I am running ffmpeg inside a script and I want to be able to quit ffmpeg either by pressing 'q' in the terminal it's running in (default behaviour) or by inputting 'q' into a fifo file, whichever I ...
0
votes
0
answers
50
views
Not able to give input to my telnet connection through fifo file if I run it from script
I have a python script which is sending commands to a fifo file through this command.
printf "command" > my1.fifo
An another process (telnet login) is taking input from this my1.fifo ...
0
votes
1
answer
1k
views
Writing in the file descriptor of the child process (fd/0)
I'm playing with file descriptors in my CentOS 7 sandbox. In doing so, I noticed an interesting situation. Suppose we've a simple PHP script:
$step = 4 * 1024;
echo "php started\n";
while (!...
0
votes
0
answers
234
views
zsh, zpty: How to read the output of a process after it has exited?
Start some command with zpty:
zpty -d x ; zpty x 'echo hi' ; sleep 1
How do I read its output now that it has exited?
zpty -r x
Returns 2, and this behavior seems expected per the manpage.
0
votes
0
answers
355
views
Program execution hanging when trying to use fgetc() over a file stream returned by fdopen() function
I'm making a program where I'm creating 3 sets of fifos (named pipes) to comunicate over processes, I have found where the execution is hanging but not why, and now I'm stuck.
I have identified that ...
0
votes
0
answers
174
views
FIFO sometimes requires two writes to satisfy read
I found some baffling behavior on Ubuntu 18.04.4 LTS.
In one terminal, I'd like to write a private key to a FIFO.
$ mkfifo /tmp/fifo
$ chmod o-rwx /tmp/fifo
$ chmod g-rwx /tmp/fifo
$ cat id_rsa > /...
0
votes
1
answer
296
views
Command to create/connect to an I/O stream?
So I'm trying to connect to a (Lua) debugger embedded in a program by redirecting the I/O. Currently I create a pair of FIFOs for the read and write streams and connect to them using cat /tmp/...
0
votes
0
answers
194
views
Piping Multiple stdouts to Python program?
I have a program that prints in stdout and I'd like multiple instances of it where each instance's stdout is piped to a sed and then the result(of three such sed) piped to a python program. I'm doing ...
0
votes
1
answer
3k
views
Named pipe buffer after process end
I am creating named pipes in Ubuntu 18 and 16 environments in C language using gcc as compiler (mkfifo() and open()). One of the things I noticed that the named pipes remain in the filesystem after ...
0
votes
1
answer
851
views
Linux FIFO buffering depends on invocation order of readers and writers
I'm trying to write a simple python script that reads from a fifo and then writes to another fifo.
I have created two FIFOs using the following command:
$ mkfifo input
$ mkfifo output
I invoke the ...
0
votes
1
answer
184
views
Give control of terminal to server contacted via HTTP
I have an application that runs an HTTP server. The application also has a command-line interface. The app is written in Ruby and the startup time is significant. Using the command-line interface is ...
0
votes
1
answer
311
views
How to Pipe Segment of Heredoc Output to Local File
I am issuing a command to a remote device in order to run a tcpdump on one of it's interfaces, but capture the output to a local .pcap file on my Ubuntu VM. The command that I'm issuing is as follows:
...
0
votes
1
answer
42
views
How can I setup a read/write device that spawns a program?
I don't know if this is possible but I had no idea how to research this concept. Is it possible and if how do I...
create a device file (i.e. /dev/remoteclip) that will, when written to or read from, ...
0
votes
0
answers
887
views
Pipe viewer (PV) not working?
I'm trying to use Pipe Viewer on a video pipe that I'm both writing and reading from.
The below command works perfectly when I pass temp_video.h264 as an -i input to ffmpeg. However, when I attempt ...
0
votes
1
answer
1k
views
Get output from mplayer slave mode to file
I ran mplayer -slave -quiet -idle -input file=/tmp/fifo file.mp3 in screen.
Now when I use echo 'get_property volume' > /tmp/fifo I need to get volume value to .txt file. How can I do this? ...
0
votes
0
answers
227
views
Is the pipe overloaded?
I am using a coprocess to run commands in siebel server manager. I am reading commands from a text file (around 2000 commands) and executing them one by one in siebel server manager. After executing ...