Trying to launch a C-server using xinetd
I have a small stats program that I am using to get some sys stats. I am trying to launch this program on a particular port, using the xinetd system deamon.
Here is what I am doing ...
1. Added an entry here ...
root@aj-laptop:/etc/xinetd.d# cat /etc/services | grep 4040
hello 4040/tcp #my implementation
2. Added an entry here ...
root@aj-laptop:/etc/xinetd.d# cat hello
# default: on
# description: Hello World socket server
port = 4040
socket_type = stream
wait = no
user = aj
server = /home/aj/Desktop/eclipse/s/sysinfo/src/sysinfo.c
log_on_success += USERID
log_on_failure += USERID
disable = no
3. When I try and connect, I get the following error ...
root@aj-laptop:/etc# telnet localhost 4040
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
Please note that I did restart the xinetd services, after adding my hello module. I also tried using the root user in the user=aj location. Is there anything I am missing here?
My C-program simply writes to the stdout using the printf() function.
Please guide me.
Last edited by jacques83; 06-26-2011 at 09:55 PM.