Question

I'm running a server app (written in Java) under GNU/Linux which takes input (from stdin, I guess) and interprets it to run some commands. I dont want to run the app inside a terminal window (I'd like to run a daemon), but I'd still like to be able to input commands whenever I want to. I thought I might be able to do that using fifos, so I created it using mknod. The problem is cat fifofile > java... and cat fifofile | java ... fail with a "file not found" error for some reason.

Using only cat to read and write and the fifo works flawlessly.

Is there any way to fix this, or any other way to achieve the same goal?

Was it helpful?

Solution

So, Minecraft? The best way to do this is to have a bona-fide tty for the console part of the application. screen is an easy way to do that.

OTHER TIPS

Have you tried java < fifofile? What about something like exec 3<&0; exec 0<fifofile; java?

What shell are you using? You might be able to use process substitution or coprocesses if you're using a shell that supports them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top