I have a system built using the RTAI extension to Linux. It has a process that runs as root on startup. It creates some named pipes and chmod 777 them. The pipes are owned by root and have the permissions prwxrwxrwx but none of the user processes can write to or read from them. The pipes are made (in C) like this
unlink(pipename);
mkfifo(pipename, 0777);
chmod(pipename, 0777);
If I login as the user, su to root, kill the process and restart it, come out of root, the named pipes are still owned by root and have the permissions prwxrwxrwx but this time, the user processes can read and write from them.
Question: what else do I need to do so that the named pipes are accessible if the program is run as part of the boot process.
Also, how do I make sure that it is the very last process that is executed after all the comms mechanisms have been set up.
Edit
I've changed the title (old one was Setting pipe permissions for boot process)
I have finally got it working by shifting the process into rc.local. Since the coder was using RTAI, he thought that the process had to be started at the same time as all the other RTAI processes. The other processes didn't use any of the Unix comms mechanisms so it didn't matter. When he started using pipes, it had to be shifted to the end of the multiuser level.
This is the part I cannot find an explanation for: at what point in the boot process would it be OK to use pipes? I have shifted it to the end but it could be earlier.