I am using a daemon template from
http://shearer.org/en/daevel/
This daemon is simple, it listens on a port, and returns back whatever it gets on he port. If we enter 1, our connection is closed.
Now, I have tried to modify it, so that when I enter 2, it will issue a command, say wall. I did this with system("wall hi"); When I compile with this, the code gets executed well, when I enter 2, the daemon issues wall command, but then kills the child process, and due to that, my connction is closed.
In man system, it is said that system disables all forks. What shall I do, to execute some command from the daemon, without getting the client connection closed?