Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Page 1 of 2 1 2 >
Topic Options
#78940 - 09/03/2002 11:59 telnet server on empeg
smu
old hand

Registered: 30/07/2000
Posts: 879
Loc: Germany (Ruhrgebiet)
Hi.

Could someone who already installed a telnet server on his empeg write a HOWTO or make a tar-ball with the necessary files available? I would like to have a telnet server on my empegs, but I simply don't have the time currently to work out how to do it resp. which files are needed.

cu,
sven
_________________________
proud owner of MkII 40GB & MkIIa 60GB both lit by God and HiJacked by Lord

Top
#78941 - 09/03/2002 12:24 Re: telnet server on empeg [Re: smu]
Nosferatu
enthusiast

Registered: 24/08/2001
Posts: 344
Loc: France, Champagne
Here is a telnet daemon I downloaded long time ago but I cannot find where (sorry).

It is a debian package I haven't tested because I dont have Debian distro but you can extract it with alien on a Linux Box.

I think you just have to add it in your init scripts.




Attachments
77122-telnetd_0.16-4potato.1.deb (210 downloads)

_________________________
Empeg IIa - 10 Gb - Red Fascia - Tuner, the day is coming - I Will Strike From the Grey -

Top
#78942 - 09/03/2002 13:09 Re: telnet server on empeg [Re: Nosferatu]
mtempsch
pooh-bah

Registered: 02/06/2000
Posts: 1996
Loc: Gothenburg, Sweden
That package depends on a couple of other packages, whos content (or equivalents) might not be available on the empeg by default, forcing you to go hunt down those packages too - and those might have dependencies of their own...

Meaning it (probably) isn't just to drop in the telnet binary and go telnetting...
Therefore (at least that'd be the reason I would ask I if were to set up telnet) the request for a tar-ball with the needed stuff, or a description of what's needed, instead of working through the dependencies again.

/Michael
_________________________
/Michael

Top
#78943 - 09/03/2002 20:23 Re: telnet server on empeg [Re: mtempsch]
theory
new poster

Registered: 03/01/2002
Posts: 49
Loc: Victoria, BC, Canada
I installed that telnet package today. But it didn't work. I'm pretty sure the problem has something to do with the fact that there isn't a /etc/passwd file, or login and tty binaries on there.

I'm no expert, but that's just my 2 cents

-B

Top
#78944 - 10/03/2002 08:44 Re: telnet server on empeg [Re: smu]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Okay. Here's a 5 minute hack to do a telnet server. It doesn't work quite 100% at the moment because I'm not dealing with a lot of the TTY bits.

You'll need to turn on new linemode if the display is odd looking. I've only got SCRT so I can't tell you how to do it in anything else.

YMMV

I'll finish it off later on.

- Trevor


Attachments
77237-emptelnetd (464 downloads)


Top
#78945 - 14/03/2002 18:07 Re: telnet server on empeg [Re: smu]
shawn
stranger

Registered: 15/11/2001
Posts: 47
Loc: Silicon Valley
quick hack:

setup debian as per riocar.org faq
adduser username
setup dns (add "nameserver x.x.x.x" to chroot'd /etc/resolv.conf)
apt-get update
apt-get install telnetd
apt-get install rsh-server (if wanted)
/usr/sbin/inetd (probably should add to init.d properly so it gets started on reboot)

Top
#78946 - 15/03/2002 09:17 Re: telnet server on empeg [Re: shawn]
smu
old hand

Registered: 30/07/2000
Posts: 879
Loc: Germany (Ruhrgebiet)
Hi.

Getting telnetd (and other) to work properly is exactly what I am after, but I wont to keep the overall memory footprint as low as possible, so I hoped to be able to path a telnetd to be standalone (not using inetd) and dynamically linked (which the debian probably is). But moreover, I was hoping to get it to work with minimal extra files (such as /bin/login, /etc/passwd, /etc/group,...), preferably with username/password set by config.ini options instead. But I guess that won't be doable without major hacking on the telnetd sources (which seem to be pretty hard to get, by the way).
These are all steps on my way to the creation of a custom .upgrade image which installs some add-on software on the empeg and will, most notably, make installation and updating of custom apps even more easy than it is now thanks to marks HiJack kernel and the pre-init/custom-init scripts.

cu,
sven
_________________________
proud owner of MkII 40GB & MkIIa 60GB both lit by God and HiJacked by Lord

Top
#78947 - 15/03/2002 09:19 Re: telnet server on empeg [Re: tman]
smu
old hand

Registered: 30/07/2000
Posts: 879
Loc: Germany (Ruhrgebiet)
Hi.

Would you mind releasing your sources?

cu,
sven

PS: I am using SCRT as well, most of the time.
_________________________
proud owner of MkII 40GB & MkIIa 60GB both lit by God and HiJacked by Lord

Top
#78948 - 15/03/2002 11:28 Re: telnet server on empeg [Re: smu]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Sure. It's only a quick hack at the moment until I can get around to doing it properly.

It's not actually using a pty/tty at the moment so it's going a little bizarre. I'm a bit overloaded with work at the moment.

- Trevor


Attachments
78896-empegtelnetd_src.tar.gz (80 downloads)


Top
#78949 - 21/03/2002 20:21 Re: telnet server on empeg [Re: tman]
suomi35
enthusiast

Registered: 16/02/2002
Posts: 290
Loc: Denver, CO
Anyone know what it would take to get this telnet app to output properly formatted lines? I am quite impressed with it so far!
_________________________
-Jason

Top
#78950 - 22/03/2002 11:40 Re: telnet server on empeg [Re: suomi35]
dclesse
member

Registered: 31/01/2001
Posts: 112
Loc: Belgium/Luxembourg
Maybe Mark could add this to hijack?
_________________________
David Clesse Belgium/Lux [blue]Mk2[/blue]-36g-tuner-stick-aug00 [orange]Riocar[/orange]-60g-jan02

Top
#78951 - 22/03/2002 17:46 Re: telnet server on empeg [Re: suomi35]
trs24
old hand

Registered: 20/03/2002
Posts: 729
Loc: Palo Alto, CA
I second that notion. Smashing good app. Cant' wait to V.2.
_________________________
- trs

Top
#78952 - 23/03/2002 13:21 Re: telnet server on empeg [Re: dclesse]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
If someone produces (or finds) a telnetd that fits in say 100-200 lines of C, uses PTYs, and has a low memory footprint.. then yes!

Top
#78953 - 23/03/2002 15:30 Re: telnet server on empeg [Re: mlord]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Since you mentioned elsewhere that you thought you saw a small telnetd implementation in an early BSD release, I went looking. The earliest BSD I could find that had a telnetd is 2.10BSD. 2.9BSD might have it, but I can't find the source for it easily, and 2.8BSD didn't have one. Anyway, the source is about 1200 lines of C and uses a lot of old sgttyb-type stuff that I'm pretty sure Linux no longer supports. It should be possible to port it, but I, honestly, don't really feel like it.

For anyone who's interested, here's a copy of the 2.10BSD source. 2.9BSD is there, as well, but it's not in an easy-to-get-at form. And here's a BSD Family Tree if anyone wants to try to find a different one. (IIRC, most of the 3/4.xBSD trunk was not freely available. Most of the changes in them were ported over to the 2.xBSD trunk, which were free. Then, starting with 4.3BSD, the free versions started being something else. The last free version was 4.4BSD Lite. But they all have enormous telnet servers anyway.)
_________________________
Bitt Faulk

Top
#78954 - 23/03/2002 17:29 Re: telnet server on empeg [Re: wfaulk]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
Mmm... maybe it was a Minix server I saw.. or perhaps just something from one of R.Stevens' books..

? -ml

Top
#78955 - 24/03/2002 13:40 Re: telnet server on empeg [Re: mlord]
suomi35
enthusiast

Registered: 16/02/2002
Posts: 290
Loc: Denver, CO
Would a properly compiled Minix server work on empeg?
_________________________
-Jason

Top
#78956 - 24/03/2002 14:19 Re: telnet server on empeg [Re: suomi35]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
Yes, it should.

-ml

Top
#78957 - 24/03/2002 14:51 Re: telnet server on empeg [Re: mlord]
genixia
Carpal Tunnel

Registered: 08/02/2002
Posts: 3411
This busybox implementation is the smallest I've found (4kB source)
ftp://ftp.simtreas.ru/pub/my/bb/ports/telnetd.c.gz

_________________________
Mk2a 60GB Blue. Serial 030102962 sig.mp3: File Format not Valid.

Top
#78958 - 25/03/2002 05:30 Re: telnet server on empeg [Re: genixia]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Okay, I've compiled the busybox implementation of telnetd.
Works quite well with the preinit utility.

It is incredibly slow when the player is running though! Pause the player if you want to do anything. I'll see if I can get around this

To install:
Upload the attached file to the empeg
Untar it (tar zxvf emptelnetd.tar.gz)
Run the devs file
You can delete the devs file and the emptelnetd.tar.gz files from your empeg now.

And finally run telnetd

YMMV

- Trevor


Attachments
81543-emptelnetd.tar.gz (106 downloads)


Top
#78959 - 25/03/2002 06:02 Re: telnet server on empeg [Re: tman]
rexkp
journeyman

Registered: 31/08/2000
Posts: 88
Nice! Thanks a bunch, this will make life easier.

nice seemed to make it more responsive with the player running:

nice -10 telnetd

Not sure if it really helped since even without it telnetd sometimes responded well.

Cheers,

Rex.

Top
#78960 - 25/03/2002 09:42 Re: telnet server on empeg [Re: rexkp]
suomi35
enthusiast

Registered: 16/02/2002
Posts: 290
Loc: Denver, CO
Great work tman. Properly formatted lines and the whole bit!
_________________________
-Jason

Top
#78961 - 25/03/2002 10:29 Re: telnet server on empeg [Re: rexkp]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
True, nice will raise the priority of the telnetd but as long as it's still scheduled with the default scheduling policy, it may still be sluggish. I'm at work so I haven't tried it yet but if telnet speed while the player is running is really important to you, you'll want to add code to change the sched policy.
_________________________
- Tony C
my empeg stuff

Top
#78962 - 25/03/2002 11:10 Re: telnet server on empeg [Re: tonyc]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
Or maybe modify the code so that it does not give up its timeslice so easily.

Top
#78963 - 25/03/2002 11:20 Re: telnet server on empeg [Re: mlord]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
Or maybe modify the code so that it does not give up its timeslice so easily.

Give up its timeslice? Other than sched_yield (which I don't see in the code) or blocking I/O, I don't know of any other way user programs "give up" their timeslice... Is there something in the telnetd source that isn't right?
_________________________
- Tony C
my empeg stuff

Top
#78964 - 25/03/2002 11:24 Re: telnet server on empeg [Re: tonyc]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14472
Loc: Canada
That's pretty much it -- any syscall() to the kernel, particularly blocking I/O, or page faults, can result in giving up the timeslice. One trick to writing fast code is to structure it so that such occurances are contained and minimized.

Don't ask me to dig through this code, though. I'd rather just write a simple replacement for it.. and I'm not even doing that.

Cheers

Top
#78965 - 25/03/2002 11:33 Re: telnet server on empeg [Re: mlord]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
Don't ask me to dig through this code, though. I'd rather just write a simple replacement for it.. and I'm not even doing that.

Wasn't even thinking of asking you for that, especially when it's already a user app... You know I have (*cough* disk writing) other things (*cough* mmap display buffer) that I would (*cough* multiple overlay apps running simultaneously) much rather you spent your time on.

I was just curious since it sounded to me like you saw something obvious in the telnetd code that I couldn't find. That stuff looks pretty lean 'n' mean to me.
_________________________
- Tony C
my empeg stuff

Top
#78966 - 25/03/2002 12:05 Re: telnet server on empeg [Re: mlord]
genixia
Carpal Tunnel

Registered: 08/02/2002
Posts: 3411
Hmm...maybe it's nearly time for me to learn the intracacies of socket programming and kernel threading...surely this thing could be integrated into khttpd/kftpd somehow?
_________________________
Mk2a 60GB Blue. Serial 030102962 sig.mp3: File Format not Valid.

Top
#78967 - 25/03/2002 13:22 Re: telnet server on empeg [Re: genixia]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
I could change the daemons scheduling algorithm but I really don't want to do that.

The main loop in the daemon continually does syscalls to read/write the sockets. Which is why I guess it's not getting much CPU time as the player seems to be running at a higher priority.

I may just leave it as is though. How many times do most people need ethernet shell access to the player really? If necessary just pause it?

Anybody got any good arguments for changing this?

- Trevor

Top
#78968 - 25/03/2002 13:39 Re: telnet server on empeg [Re: tman]
suomi35
enthusiast

Registered: 16/02/2002
Posts: 290
Loc: Denver, CO
I think it's fine as-is for its purpose...haven't really noticed the speed issue myself.
_________________________
-Jason

Top
#78969 - 25/03/2002 13:47 Re: telnet server on empeg [Re: tman]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
Probably not a big deal. I was just mentioning it because someone said it was running real slow. If it's too slow then going to realtime scheduling would help, and as long as the priority wasn't too high, wouldn't interfere with player operation. A couple of the things I've wrote are using round-robin scheduling and the speed difference was very noticable, but they're doing more complex things than a telnetd would be doing.

So, leave it as is.
_________________________
- Tony C
my empeg stuff

Top
Page 1 of 2 1 2 >