Skip to contentSkip to conversation

Mapping con=pts to a port instead of con=port

uml-devel Dan Shearer 2 participants 3 messages Jan 24, 2004 – Jan 28, 2004 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

Jeff,

Quoted 2 lines · You just

I never heard of termnetd. I think it's less likely to be installed on a given system than telnetd though :-)

True. And it isn't a replacement for the port console, but a different approach to solving the same problem. In researching how the port console stuff works, I saw your original post from 31/12/2000 where you

Quoted 5 lines · said:

So, what I need, and can't find, is a telnetd that's willing to attach to a device rather than a port. This would run inside UML in place of the current getty. A minicom-like proggie that doesn't do protocol won't work because the two sides need to talk about terminal modes and stuff. Does anyone know of such a beast?

The same effect can be achieved with termnetd, with the advantage of your in.telnetd solution that you aren't building in complexity that doesn't belong to UML, but without the clomp-clomp finesse telnetd achieves :-)

I run uml with con1=pts etc and then expose those ptys using termnetd. The dynamic nature of /dev/ptmx results means you need to use mconsole's config commmand to work out what port to attach to.

termnetd is part of termpkg, the poor man's terminal server. "Good for simulations" it says on the homepage so it has to be a winner. See
http://www.linuxlots.com/~termpkg. Only thing it doesn't do is Unix98 ptys, fix follows. It listens on INADDR_ANY, which is a bad thing I should fix too.

Look for tndCfgParse.l within termnetd within termpkg 3.3. It is is a flex (as in the lexical analyser) definition for parsing the config file for termnetd (a nice approach given that he's implemented lots of termios stuff there with potential for a very complicated parser.)

tndCfgParse.l 2004-01-24 15:09:53.000000000 +1030 renamed from tndCfgParse.l.orig 2004-01-24 15:09:17.000000000 +1030 +1 -1
@@ -132,7 +132,7 @@
 [Oo][Nn]      { return(YY_ON); }
 [Oo][Ff][Ff]  { return(YY_OFF); }
  
-"/dev/pts/"[0-9]{1,5} { strcpy(yylval.s, yytext); return(YY_DEVICE); }
+"/dev/"[.A-Za-z][.A-Za-z0-9_-]*|"/dev/pts/"[0-9]{1,5} { strcpy(yylval.s, yytext); return(YY_DEVICE); }
  
 [0-9A-Za-z_-]+ { strcpy(yylval.s, yytext); return(YY_IDENT); }
 .              { return(yytext[0]); }
Signature · 13 lines
Dan Shearer
[email protected]


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#1 lore raw

Let's get the versions right. Patch is actually:

tndCfgParse.l renamed from tndCfgParse.l.orig +2 -1
@@ -132,7 +132,8 @@
 [Oo][Nn]      { return(YY_ON); }
 [Oo][Ff][Ff]  { return(YY_OFF); }
  
-"/dev/"[.A-Za-z][.A-Za-z0-9_-]* { strcpy(yylval.s, yytext); return(YY_DEVICE); }
+"/dev/"[.A-Za-z][.A-Za-z0-9_-]*|"/dev/pts/"[0-9]{1,5} { strcpy(yylval.s, yytext); return(YY_DEVICE); }
+
 [0-9A-Za-z_-]+ { strcpy(yylval.s, yytext); return(YY_IDENT); }
 .              { return(yytext[0]); }
 
Signature · 13 lines
Dan Shearer
[email protected]


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#2 lore raw
In reply to Dan Shearer
Quoted 4 lines · [email protected] said:

The same effect can be achieved with termnetd, with the advantage of your in.telnetd solution that you aren't building in complexity that doesn't belong to UML, but without the clomp-clomp finesse telnetd achieves :-)

Yeah, but it has uncleanlinesses of its own (like the need to generate a config file on the fly), but it's cleaner than what I have now.

My major problem with it is that attaching consoles to ports will stop working for some number of users if I switch to termnetd, and I'm willing to put up with some amount of nastiness inside UML if it increases the size of the userbase that UML works for out of the box.

That concern would be somewhat assuaged if UML were generally installed with packages that could be made to depend on termpkg, but I think that's not the case.

Jeff

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel