Create an inetd sub-server

der Mouse mouse at thunder.mcrcim.mcgill.edu
Mon Jul 1 10:55:55 AEST 1991


In article <1991Jun25.071855.20102 at grasp1.univ-lyon1.fr>, wolf at grasp1.univ-lyon1.fr (Christophe Wolfhugel) writes:

> I wish to create a new service working under inetd that, as with
> telnet,ftp does stdio with the peer.

> So I created a small program that does nothing except printf a text +
> fflush(stdout).

> [This works.]

> I added a service in /etc/services similar to telnet, with a new name
> and a new port number (I tried unused priviledges and non priviledged
> port nulmbers).

> I added a line in /etc/inetd.conf pointing to my program for the new
> defined service and refreshed inetd.

Some inetds don't do the right thing with SIGHUP; try killing and
restarting inetd.

Also, if you did this too soon after killing off the old daemon, there
may be a stray socket lying around that hasn't timed out yet.

> telnet host new_service hangs, as if inetd could not start the
> application (the connection is established).

If inetd can't start the daemon, you will normally see the connection
succeed and then close instantly.  Something else is probably hanging.

> Did I miss an important step?

Did you remember to fix the daemon so it expects the connection to be
already established on file descriptor 0 instead of trying to do the
dance with socket, bind, accept, etc?

					der Mouse

			old: mcgill-vision!mouse
			new: mouse at larry.mcrcim.mcgill.edu



More information about the Comp.unix.questions mailing list