|
Trying to launch a C-server using xinetd
Hello folks,
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
service hello
{
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
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
root@aj-laptop:/etc#
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.
Regards,
AJ
Last edited by jacques83; 06-26-2011 at 08:55 PM.
|