inetd process


 
Thread Tools Search this Thread
Operating Systems HP-UX inetd process
# 1  
Old 05-31-2006
inetd process

--------------------------------------------------------------------------------
Hi All ,

I have a client an server among which i want to make the server an inetd process.

I have enries in etc/services and etc/inetd.conf
The enries looks like below
etc/services
servername 5551/tcp
etc/inetd.conf

servername stream tcp nowait root /servername servername

Now if I try to run my client ,inetd will spwan the server but the bind in the serve is failing synag tht address is already in use

My client code to connect ins ome thng like this
====================================
sd = socket (AF_INET, SOCK_STREAM, 0); CHK_ERR(sd, "socket");

memset (&sa, '\0', sizeof(sa));
sa.sin_family = AF_INET;
sa.sin_addr.s_addr = inet_addr ("127.0.0.1"); /* Server IP */
sa.sin_addr.s_addr = inet_addr ("164.164.27.88");
sa.sin_port = htons (5551); /* Server Port number */

err = connect(sd, (struct sockaddr*) &sa,
sizeof(sa)); CHK_ERR(err, "connect");

/* ----------------------------------------------- */
/* Now we have TCP conncetion. Start SSL negotiation. */

ssl = SSL_new (ctx); CHK_NULL(ssl);
SSL_set_fd (ssl, sd);
err = SSL_connect (ssl); CHK_SSL(err);


and my server code is like below
==========================
/* Prepare TCP socket for receiving connections */

listen_sd = socket (AF_INET, SOCK_STREAM, 0); CHK_ERR(listen_sd, "socket");

memset (&sa_serv, '\0', sizeof(sa_serv));
sa_serv.sin_family = AF_INET;
sa_serv.sin_addr.s_addr = INADDR_ANY;
sa_serv.sin_port = htons (5551); /* Server Port number */

err = bind(listen_sd, (struct sockaddr*) &sa_serv,
sizeof (sa_serv)); CHK_ERR(err, "bind");

/* Receive a TCP connection. */

err = listen (listen_sd, 5); CHK_ERR(err, "listen");

client_len = sizeof(sa_cli);
//Binu
sd = accept (listen_sd, (struct sockaddr*) &sa_cli,(int *) &client_len);
CHK_ERR(sd, "accept");
close (listen_sd);


can any one please help me?

Thanks
Binu
# 2  
Old 05-31-2006
You can't listen to a port and also ask inetd to do the listen. It's one or the other. inetd will do the bind, listen, and accept then fork and finally exec your server.
# 3  
Old 06-01-2006
Can you please tell me how I can change my code ..
Thanks a lot in advance
Binu
# 4  
Old 06-01-2006
Hi ,

Actually i have removed the bind calls as it is not required .Now the problem is that, I m not sure to which sd i have to do a read and write .

( I m using SSL server.Hence i m using SSL_read ,SSL_write etc )

Binu
# 5  
Old 06-01-2006
0 and 1 **
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Inetd not running on zone

inet not running on the zone , below is the error we see on svc log Importing 100235_1-rpc_ticotsord.xml ...Done inetconv: Error reading from repository inetconv: Notice: Service manifest for 100235/1 already generated as /var/svc/manifest/network/rpc/100235_1-rpc_ticotsord.xml, skipped... (0 Replies)
Discussion started by: skamal4u
0 Replies

2. Solaris

Inetd problem

Hi All, When i am trying to restart the inetd daemon it throughing error. Please find the message and tell me what i need to do ? Apr 7 22:57:37 HYDOHS01 inetd: ISTATE not in environment Apr 7 22:57:41 HYDOHS01 inetd: stop: No such file or directory Apr 7 22:58:01 HYDOHS01 inetd: ... (5 Replies)
Discussion started by: lbreddy
5 Replies

3. UNIX for Dummies Questions & Answers

too many inetd running

hi, is it ok for more than one inetd daemon running at a time? if not okay, possible to kill the rest and make only one daemon running? i understand that inetd is a process that enables tcp connections from external sources...kindly advise more on inetd...thanks alot..Happy New Year!:) (2 Replies)
Discussion started by: cromohawk
2 Replies

4. Shell Programming and Scripting

Run a process through inetd using korn shell!!!

Hi, I am trying to run a process through inetd using ksh. The entry in /etc/inetd.conf is Process_Name tcp nowait root /home/user/script script The script is as follows /usr/bin/ksh -c /path/process Recycling inetd services is successfully completed. But when the process is accessed... (8 Replies)
Discussion started by: vishi_82
8 Replies

5. UNIX for Dummies Questions & Answers

Cannot edit inetd.conf???

I'm trying to edit the inetd.conf but for some reason when I vi into it, it says "Read Only" even though I am root and the perms are 777?!? (2 Replies)
Discussion started by: shorty
2 Replies

6. IP Networking

Error inetd

Hi , I need help, today I restarted the server, when the machine was up, it had been to writte in the file osmlog that : "inetd: talk/udp: bind: Address already in use" This message appears in ten minutes every time. Why ? Thanks. (6 Replies)
Discussion started by: By_Jam
6 Replies

7. Red Hat

inetd.conf in linux

I need to put the following line in inetd.conf: stats stream tcp nowait nobody /usr/local/bin/mrtgsysinfo mrtgsysinfo but my version of linux don't seem to allow that, ie there is no inetd.conf. How do i set that up in linux (red hat enterprise 3). (15 Replies)
Discussion started by: frankkahle
15 Replies

8. HP-UX

VNC using inetd on HPUX

To anyone who can help. I am trying to get VNC running using the inetd capability and I am having problems. I have VNC running fine when I manually log into the server through FTP or SSH and start it and then start the viewer on my PC. I have tried a few things I have found on different... (0 Replies)
Discussion started by: punkdeviant
0 Replies

9. Shell Programming and Scripting

refreshing inetd

Hi I have a question, what is the purpose of this command and what will it do "refresh -s inetd" Thanks in Advance Swaraj (3 Replies)
Discussion started by: kswaraj
3 Replies

10. UNIX for Dummies Questions & Answers

Inetd and security

Ok, So I've been lazy over the past 3 years with the SCO server I maintain, as it just primarily hosts my private networked proprietary software, until now. We have dedicated net access, in which the SCO server is not setup for and not going to be setup to connect to the internet by any direct... (8 Replies)
Discussion started by: ftn96
8 Replies
Login or Register to Ask a Question