supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* How to make a "telnetd" using tcpsvd and bash ?
@ 2003-08-11 14:16 Uffe Jakobsen
  2003-08-11 15:30 ` Laurent Bercot
  0 siblings, 1 reply; 2+ messages in thread
From: Uffe Jakobsen @ 2003-08-11 14:16 UTC (permalink / raw)



Hi,

During the preparation of some material that should try to explain my
collegues about the wonderful world of easy daemon-making using either
"runit/ipsvd" or "daemontools/ucspi-tcp" I wanted to make a "sample telnetd"
using runsv, tcpsvd and bash...

That sounds easy and I have it almost working, except that all of my typing
on the terminal goes into the log instead of going back to the termainal the
same goes for the "prompt" showing working-dir and username...

Below is my run script for runsv:

#!/bin/sh
exec 2>&1
exec tcpsvd -v -vv -l demohost 0.0.0.0 2323 fixcrio
/usr/bin/bash --login --noprofile --norc -i
# EOF

As stated before the above works fine except that I can't see my own typing
or error msgs - only the output of the command is correctly returned to my
"client"...

I believe that I've tried every redirection combination in the world - but
with no result.

I'm currently working on a Sun (UltraSPARC II) Solaris 8 platform.

Any help and suggestions is much appreciated.

Kind regards Uffe Jakobsen




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to make a "telnetd" using tcpsvd and bash ?
  2003-08-11 14:16 How to make a "telnetd" using tcpsvd and bash ? Uffe Jakobsen
@ 2003-08-11 15:30 ` Laurent Bercot
  0 siblings, 0 replies; 2+ messages in thread
From: Laurent Bercot @ 2003-08-11 15:30 UTC (permalink / raw)


> During the preparation of some material that should try to explain my
> collegues about the wonderful world of easy daemon-making using either
> "runit/ipsvd" or "daemontools/ucspi-tcp" I wanted to make a "sample telnetd"
> using runsv, tcpsvd and bash...
> 
> That sounds easy and I have it almost working, except that all of my typing
> on the terminal goes into the log instead of going back to the termainal the
> same goes for the "prompt" showing working-dir and username...

 The problem is that the shell on the server is not running in a terminal.
telnetd (and sshd), when used interactively, creates a pty, and runs its
child in it, so that the child runs exactly as if it wasn't invoked by
some network server.
 Telnet-like protocols in interactive sessions are not so easily faked
by just a tcpserver and a shell: they do something more, i.e. pseudo-
terminal allocation and handling. This is one of the hairiest and
ugliest parts of Unix - welcome to the machine.

 I had a try at it some time ago, using DJB's ptyget package to perform
the server-side pseudo-terminal work. It kind of worked, but wasn't in
the least cool, maintainable nor portable. Besides, I had no client
support (you need to put the client terminal in raw mode, transmit
SIGWINCH information, and so on). I gave up. But I still have the idea
in the back of my mind.
 If you want to have a go at it, the ttymodes library, from skalibs
(http://www.skarnet.org/software/skalibs/libttymodes.html), inspired
from the ptyget package, may help you. Good luck, Jim.

-- 
 Ska


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-08-11 15:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-11 14:16 How to make a "telnetd" using tcpsvd and bash ? Uffe Jakobsen
2003-08-11 15:30 ` Laurent Bercot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).