OK, now I am confused. When script is listening for the data on the socket, isn't STDIN whatever script receives from that socket? If so, then whenever I make the script to run as a daemon, I won't be able to receive anything on the socket since STDIN will be detached. Am I right? What I have is a script listening for the data on the socket, and I want that script to run in the background all the time and process whatever I get from that socket. By the way, how should I enable this daemon to run at startup? Is it enough just to add it to one of startup files, or should I use runlevel folders?... Thanks for the help.