FIFO question
I am running a dedicated Neverwinter Nights server running on my RH8.0 Linux box. If you run this service with the correct options you can type commands into the server to load modules and broadcast server messages and such. What I want to do (simply for learning's sake) is to have my backup script on my server tell the NWN process to broadcast a message warning of lag caused by the backup.
I asked on a NWN Server Admin forum how to go about this and I was told to look into FIFOs. I did some peeking around on what they are. I was unable to get a firm grasp on how to have a service read a FIFO. The only command that I've found that is related to this is mkfifo, which seems quite simple. Could anyone walk me through making a service take it's input from a FIFO instead of from standard input, how to make a script write to a FIFO, and anything else that's relevant to the issue? |
Official disclaimer: I have never used FIFOs, so please don't take what I suggest as gospel, truth, or anything remotely resembling an authoratative response.
I read the man page for mkfifo and it didn't say much other than "use this command to make a fifo"... duh. So I tried: Code:
apropos FIFO Code:
man 4 fifo Code:
echo "Server may experience lag from backup process" > /path/to/fifo I don't know if it will be an issue for you, but you should have a process trying to read the FIFO before a different process writes to it. The kernel has nowhere to send the write data if nobody is ready to read it. If this doesn't get you started, and nobody else jumps in, you may be better served asking a similar question in a programming forum. FIFOs are a classic programming language structure. You may get a lot of technical details and a lot of it will probably be geared toward implementing a FIFO in C, but you should be able to get what you need. |
All times are GMT -5. The time now is 10:14 PM. |