Unoffical empeg BBS

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

Topic Options
#206539 - 24/02/2004 02:57 telnet & /etc/profile
SonicSnoop
addict

Registered: 29/06/2002
Posts: 531
Loc: Triangle, VA
I have gotten telnet working on my riocar but when i log in it doesnt load the /etc/profile is there another file it loads when coming in by telnet or something i can change to make it load it? thanks..
_________________________
-D Modifying and Tweaking is a journey, not a destination................................ MKIIa : 60gig - 040103286 - Blue - v2 + PCATS tuner MKIIa : 20gig - 040103260 - Blue - v3a8 + Mark Lord Special Edition Cherry Dock

Top
#206540 - 24/02/2004 08:26 Re: telnet & /etc/profile [Re: SonicSnoop]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
On a Linux box, try "man bash".

Top
#206541 - 24/02/2004 15:27 Re: telnet & /etc/profile [Re: mlord]
SonicSnoop
addict

Registered: 29/06/2002
Posts: 531
Loc: Triangle, VA
Im sorry if this seems like a stupid question but I have created a ~/.bash_profile , ~/.bash_login , ~/.profile , and a ~/.bashrc and none of them load. those were all i could see in man bash
_________________________
-D Modifying and Tweaking is a journey, not a destination................................ MKIIa : 60gig - 040103286 - Blue - v2 + PCATS tuner MKIIa : 20gig - 040103260 - Blue - v3a8 + Mark Lord Special Edition Cherry Dock

Top
#206542 - 24/02/2004 16:19 Re: telnet & /etc/profile [Re: SonicSnoop]
JBjorgen
carpal tunnel

Registered: 19/01/2002
Posts: 3584
Loc: Columbus, OH
did you try /etc/bashrc (a guess...I haven't tried it myself) ?
_________________________
~ John

Top
#206543 - 24/02/2004 20:18 Re: telnet & /etc/profile [Re: SonicSnoop]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
The binary from my player has these strings inside of it:

/etc/bash.bashrc
/etc/profile
~/.profile
~/.bash_profile
~/.bash_login



Top
#206544 - 24/02/2004 20:33 Re: telnet & /etc/profile [Re: mlord]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
Yeah, but it doesn't try to source them (any of them) when you log in.
_________________________
- Tony C
my empeg stuff

Top
#206545 - 24/02/2004 20:33 Re: telnet & /etc/profile [Re: tonyc]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
strace ?

Top
#206546 - 24/02/2004 20:37 Re: telnet & /etc/profile [Re: mlord]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
Gimme a sec..
_________________________
- Tony C
my empeg stuff

Top
#206547 - 24/02/2004 20:42 Re: telnet & /etc/profile [Re: mlord]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA

[empeg:/]# strace -e open bash
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/libncurses.so.5", O_RDONLY) = 3
open("/lib/libdl.so.2", O_RDONLY) = 3
open("/lib/libc.so.6", O_RDONLY) = 3
open("/dev/tty", O_RDWR|O_NONBLOCK) = 3
open("/etc/nsswitch.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/libnss_compat.so.2", O_RDONLY) = 3
open("/usr/lib/libnsl.so.1", O_RDONLY) = 3
open("/etc/nsswitch.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/passwd", O_RDONLY) = 3
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/libnss_files.so.2", O_RDONLY) = 3
open("/etc/bash.bashrc", O_RDONLY) = -1 ENOENT (No such file or directory)
open("//.bashrc", O_RDONLY) = -1 ENOENT (No such file or directory)
open("//.bash_history", O_RDONLY) = 3
open("//.bash_history", O_RDONLY) = 3
--- SIGCHLD (Child exited) @ 0 (0) ---
--- SIGCHLD (Child exited) @ 0 (0) ---
open("/etc/terminfo/v/vt100", O_RDONLY) = 3
.

strace with a valid and executable /.bashrc file in a moment..
_________________________
- Tony C
my empeg stuff

Top
#206548 - 24/02/2004 20:49 Re: telnet & /etc/profile [Re: mlord]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
Okay, so if I telnet in with a valid /.bashrc file, it doesn't get sourced, but when I run bash manually, it does. I'm guessing this is a limitation of our stripped-down telnetd?

Here's the strace of the shell I started after I telnetted in (as evidenced by the default shell prompt instead of the one in my bashrc, this wasn't sourced for the shell given to me by telnetd.

sh-2.03# /usr/local/bin/strace -e open bash
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/libncurses.so.5", O_RDONLY) = 3
open("/lib/libdl.so.2", O_RDONLY) = 3
open("/lib/libc.so.6", O_RDONLY) = 3
open("/dev/tty", O_RDWR|O_NONBLOCK) = 3
open("/etc/nsswitch.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/libnss_compat.so.2", O_RDONLY) = 3
open("/usr/lib/libnsl.so.1", O_RDONLY) = 3
open("/etc/nsswitch.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/passwd", O_RDONLY) = 3
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/libnss_files.so.2", O_RDONLY) = 3
open("/etc/bash.bashrc", O_RDONLY) = -1 ENOENT (No such file or directory)
open("//.bashrc", O_RDONLY) = 3
open("/etc/terminfo/v/vt100", O_RDONLY) = 3
open("//.bash_history", O_RDONLY) = 3
open("//.bash_history", O_RDONLY) = 3
--- SIGCHLD (Child exited) @ 0 (0) ---
--- SIGCHLD (Child exited) @ 0 (0) ---
open("/etc/terminfo/v/vt100", O_RDONLY) = 3

.
_________________________
- Tony C
my empeg stuff

Top
#206549 - 24/02/2004 21:03 Re: telnet & /etc/profile [Re: tonyc]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
rather than strace, you can use this:

[hijack]
trace_fs=1

And then telnet in and see what it did by watching the serial port.

Cheers

Top
#206550 - 24/02/2004 21:04 Re: telnet & /etc/profile [Re: tonyc]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Oops. If you're using the one I compiled then it's because I didn't set it to be a login shell. I never needed it to run .profile/.bashrc so I didn't set the option. I'll upload a new version in a sec.

Top
#206551 - 24/02/2004 21:08 Re: telnet & /etc/profile [Re: tman]
SonicSnoop
addict

Registered: 29/06/2002
Posts: 531
Loc: Triangle, VA
Thank you for figuring this out everyone.. I was lost, I was doing so many google searches trying to figure out what i was doing wrong. I dont know a whole lot about linux yet but am trying to learn. Was afraid I was doing something wrong. Its good to know I wasnt..
_________________________
-D Modifying and Tweaking is a journey, not a destination................................ MKIIa : 60gig - 040103286 - Blue - v2 + PCATS tuner MKIIa : 20gig - 040103260 - Blue - v3a8 + Mark Lord Special Edition Cherry Dock

Top
#206552 - 24/02/2004 21:12 Re: telnet & /etc/profile [Re: mlord]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
Oh, sweet. Gotta quit the player for it to pick up the config change though, yes?
_________________________
- Tony C
my empeg stuff

Top
#206553 - 24/02/2004 21:23 Re: telnet & /etc/profile [Re: tonyc]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Yeah..

Top
#206554 - 24/02/2004 21:57 Re: telnet & /etc/profile [Re: SonicSnoop]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Okay. I've uploaded the new version. It works fine when tested on my emepg but keep a serial cable handy just in case!

Top
#206555 - 24/02/2004 22:15 Re: telnet & /etc/profile [Re: tman]
SonicSnoop
addict

Registered: 29/06/2002
Posts: 531
Loc: Triangle, VA
When I try to run this new telnetd I get :

'(null)' unavailable.empeg:/empeg/bin#

ill do a search see if its something i missed but just thought Id mention it..
_________________________
-D Modifying and Tweaking is a journey, not a destination................................ MKIIa : 60gig - 040103286 - Blue - v2 + PCATS tuner MKIIa : 20gig - 040103260 - Blue - v3a8 + Mark Lord Special Edition Cherry Dock

Top
#206556 - 24/02/2004 22:26 Re: telnet & /etc/profile [Re: SonicSnoop]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Hmm. I'll have to check. Give me a few minutes.

Top
#206557 - 24/02/2004 22:31 Re: telnet & /etc/profile [Re: SonicSnoop]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Try it again. I uploaded the wrong version but it should be okay now.

Top
#206558 - 24/02/2004 22:41 Re: telnet & /etc/profile [Re: tman]
SonicSnoop
addict

Registered: 29/06/2002
Posts: 531
Loc: Triangle, VA
It works great now! Thank you for your help!
_________________________
-D Modifying and Tweaking is a journey, not a destination................................ MKIIa : 60gig - 040103286 - Blue - v2 + PCATS tuner MKIIa : 20gig - 040103260 - Blue - v3a8 + Mark Lord Special Edition Cherry Dock

Top