Unoffical empeg BBS

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

Page 1 of 2 1 2 >
Topic Options
#15971 - 29/08/2000 20:13 Setting up ftp
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
TODO: figure out how to change /sbin/init to start inetd
TODO: how do you find out which drive the file was transfered from empeg.csv.
Is it the second to the last number?
TODO: Figure out how to update the Debian image to the latest and greatest.

1) Download the Debian root image from
here
and download stuff.tgz from this attachment.

2) Transfer it with a version of emplode that transfers non-mp3 files. I
put it into Unattached items.

3) Figure out what the files are now named. Ex for the first file:
Export the database
Tools->Export Database to CSV
Edit that file and search for debian-image_990822.tar Ex:
2474,"tune","9651112","debian-image_990822.tar","Unknown","","","","","","","","","","","",1,""
2477,"tune","1003","stuff","Unknown","","","","","","","","","","","",1,""
Start a calculator and multiply that result by 16 and then
convert it into hex. The windows calculator can do this with
View->Scientific. Ex:
9aa0
9ad0

For the rest of the sample, debian-image_990822.tar.gz is /drive0/fids/9aa0
and stuff.tgz is /drive0/fids/9ad0

4) Extract the following from the Debian root image (ftp daemon, ftp, ping,
find, passwd, su, which, and vi). You can delete files afterwards if you
don't want them or you can delete them from filelist before hand.
cd /
rw
rwm
tar -xvzf /drive0/fids/9ad0 tmp/filelist
tar -xvzpf /drive0/fids/9aa0 -T tmp/filelist
chmod +s /bin/su
ln -s /usr/bin/nvi /usr/bin/vi
rm /tmp/filelist

5) For convienience, I have included some files that you have to modify in
stuff.tgz. To replace them, do the following:
tar -xvzf /drive0/fids/9ad0
Here is what is changed in each file
etc/group
This contains valid groups in your system. This file contains root,
ftp, and nobody. Do what ever you want to it if you understand the
format and function of it.
etc/passwd
This contains valid users in your system. This file contains root,
ftp, and nobody. Root and ftp have no passwords. Do what ever you
want to it if you understand the format and function of it.
To change the password for ftp, for example, do the following:
passwd ftp
etc/hosts.deny
This says what hosts are denied. I removed the PARANOID line.
etc/hosts
This says what ip addresses do not need to be DNSed. I added
localhost.

6) Optional: start up the loop-back interface that listens to localhost.
ifconfig lo 127.0.0.1 up

7) Make sure that dns can work. Correct the last line of /etc/resolv.conf
so that it points to a valid dns server. The first line is your default
domain.
vi /etc/resolv.conf
Test is out with
ping www.empeg.com

NOTE: To figure out your DNS server under Windows, type winipcfg. Click
on More Info and use the DNS Servers field. Under Linux, just use
/etc/resolv.conf.

8) Start/Restart the inet daemon. Do a ps -e | grep inetd
If it is running, then there will be at least one line that says only "inetd"
instead of "grep inetd". Ex:
empeg:/# ps -e | grep inetd
38 ? 00:00:00 inetd
empeg:/# kill -HUP 38
Otherwise, just start it up.
inetd

9) Make sure you can become the user ftp. The first su is free since you are
root. The second one asks you for your password.
su nobody
su ftp
ls
logout
logout
NOTE: If you see "su: cannot run /bin/bash: Permission denied", then do the
following. I don't know why there are no permissions for many of the
critical files. I don't remember changing this before.
chmod ugo+rx /lib /lib/*
chmod ugo+rx / /bin /bin/* /etc

10) Test it out!

11) To connect locally (with empeg's environment. Make sure to follow setp 6):
ftp 127.0.0.1

12) To connect within your LAN:
ftp 192.168.1.105

13) Clean up
ro
rom

NOTE: for security reasons, you cannot login as root via ftp.

Special thanks to kim, mcomb and [url=http://www.linuxgazette.com/issue52/okopnik.html]this.

I never thought I would have so many problems with su!




Attachments
2-15005-stuff.tgz (95 downloads)


Top
#15972 - 30/08/2000 10:30 Re: Setting up ftp [Re: hamzy]
dionysus
veteran

Registered: 16/06/1999
Posts: 1222
Loc: San Francisco, CA
How much memory does the ftp daemon take up? Ideally, I would like ftp to be enabled while inside, but disabled in the car...
-mark

...proud to have owned one of the first Mark I units
_________________________
http://mvgals.net - clublife, revisited.

Top
#15973 - 30/08/2000 10:34 Re: Setting up ftp [Re: hamzy]
dionysus
veteran

Registered: 16/06/1999
Posts: 1222
Loc: San Francisco, CA
...also, to quote Kim's message, here's how to setup the init script:
In reply to:

I have a menu driven boot loader but it would need some modifications to make it work on other environments as well. It assumes that the /dev/hda2 partition exists and can be mounted to specific location, etc.

But in your case, it would probably be easiest to just write a simple /sbin/init script replacement, like:

#!/bin/sh
PATH=./:/bin
PS1=empeg:\\w\\$
/bin/mount -n -o nocheck,rw /proc
/bin/mount -n -o nocheck,ro /dev/hda4 /drive0
/empeg/bin/player

And then you could add whatever network stuff you want before/after the empeg player software.



...proud to have owned one of the first Mark I units

_________________________
http://mvgals.net - clublife, revisited.

Top
#15974 - 30/08/2000 11:08 Re: Setting up ftp [Re: dionysus]
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
I don't know yet. As I said in an earlier post, the empeg is not connected to the network right now. I should see how easy setting up PPP over the serial link is.

Anyways, the Debian root tar has top inside. An example of running it shows:

 11:08am  up  2:26,  0 users,  load average: 0.01, 0.02, 0.01
8 processes: 7 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: 0.3% user, 0.1% system, 0.0% nice, 99.4% idle
Mem: 10920K av, 7484K used, 3436K free, 1740K shrd, 3104K buff
Swap: 0K av, 0K used, 0K free 2012K cached

PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME COMMAND
198 root 1 0 892 892 716 R 0 0.5 8.1 0:01 top
1 root 0 0 80 80 60 S 0 0.0 0.7 0:04 init
2 root 0 0 0 0 0 SW 0 0.0 0.0 0:00 kflushd
3 root 0 0 0 0 0 SW 0 0.0 0.0 0:00 kupdate
4 root 0 0 0 0 0 SW 0 0.0 0.0 0:00 kpiod
5 root 0 0 0 0 0 SW 0 0.0 0.0 0:00 kswapd
45 root 0 0 76 76 0 S 0 0.0 0.6 0:00 inetd
182 root 0 0 1240 1240 964 S 0 0.0 11.3 0:00 bash

I will run it at home with a ftp session running.
Hrm. It looks like I need to set the time zone environment variable.



Top
#15975 - 30/08/2000 11:09 Re: Setting up ftp [Re: dionysus]
altman
carpal tunnel

Registered: 19/05/1999
Posts: 3457
Loc: Palo Alto, CA
You can do stuff with grepping /proc files (like /proc/empeg_power) to start certain services dependent on power source if you're feeling adventurous...

Hugo



Top
#15976 - 30/08/2000 11:17 Re: Setting up ftp [Re: hamzy]
dionysus
veteran

Registered: 16/06/1999
Posts: 1222
Loc: San Francisco, CA
dang; just managed to kill my empeg; I'm re-flashing the consumer ver1 again:( something went wrong w/ the init file..

Here's the init that I used:
#!/bin/sh
PATH=./:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
PS1=empeg:\\w\\$
/bin/mount -n -o nocheck,rw /proc
/bin/mount -n -o nocheck,ro /dev/hda4 /drive0
/empeg/bin/player
inetd

...In theory, once it dumps out of the player, it should start inetd, right? only problem is that I can't get a prompt after I kill the player... Also, inetd never starts up... Ideas?

Also, it's worth noting the menu option for "quit" here:
(copied from Clemsonjeep)
In reply to:

) type rwm, then rw to mount the partitions read-write.
5) cd /empeg/var
6) echo "[Menu]" >> config.ini
7) echo "quit=1" >> config.ini
8) type rom, then ro, to mount the partitions read-only.




...proud to have owned one of the first Mark I units

_________________________
http://mvgals.net - clublife, revisited.

Top
#15977 - 30/08/2000 11:30 Re: Setting up ftp [Re: dionysus]
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
I would move inetd in front of player and start it in the background with an ampersand at the end.

But what I meant originally was to play with the binary program init (as well as play with the shell script one).

Thanks Hugo for the idea of grepping the /proc/empeg_power file.


Top
#15978 - 30/08/2000 12:20 Re: Setting up ftp [Re: hamzy]
dionysus
veteran

Registered: 16/06/1999
Posts: 1222
Loc: San Francisco, CA
OK - now I'm getting

empeg:/# ftp 10.227.132.82
neighbour table overflow
ftp: connect: No buffer space available
ftp>

Any ideas? Ping works fine..

-mark

update - just mysteriously started working????
...proud to have owned one of the first Mark I units

Edited by dionysus on 30/8/00 08:56 PM.

_________________________
http://mvgals.net - clublife, revisited.

Top
#15979 - 30/08/2000 12:38 Re: Setting up ftp [Re: hamzy]
kim
member

Registered: 21/07/1999
Posts: 140
Loc: Helsinki, Finland
I would move inetd in front of player and start it in the background with an ampersand at the end.

Keep in mind that all empeg-player threads run using realtime scheduler which means that any "normal" programs that are in background gets very little time, as they have much lower priority.

Kim


Top
#15980 - 30/08/2000 12:49 Re: Setting up ftp [Re: kim]
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
Interesting.

I thought that Hugo? said that only 30% of the CPU was being utilized. With a real time task running, I can't see that the ethernet's interrupts are not being serviced since emplode can work when the player is playing.
70% should be more than enough to service inetd and ftpd.


Top
#15981 - 30/08/2000 12:50 Re: Setting up ftp [Re: kim]
dionysus
veteran

Registered: 16/06/1999
Posts: 1222
Loc: San Francisco, CA
In reply to:


Keep in mind that all empeg-player threads run using realtime scheduler which means that any "normal" programs that are in background gets very little time, as they have much lower priority.


...Which is fine; ftp is very slow w/ the player working, but it at least runs... (well.. Did.. mine broke; see my above post..) the user can always "quit" to give the background item more attention..

Also, this little hack is worth noting: (from developer site:)
The following directives may be placed into the empeg player's configuration file, /empeg/var/config.ini.

[Startup]
ReduceCache=n

n = number of chunks to reduce the cache by (dev. max 48)

-mark

...proud to have owned one of the first Mark I units

_________________________
http://mvgals.net - clublife, revisited.

Top
#15982 - 30/08/2000 13:17 Re: Setting up ftp [Re: hamzy]
dionysus
veteran

Registered: 16/06/1999
Posts: 1222
Loc: San Francisco, CA
OK - here's the init string that I"m using now, it SEEMS to work, except for one minor detail:


In reply to:


#!/bin/sh
PATH=./:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
PS1=empeg:\\w\\$
/bin/mount -n -o nocheck,rw /proc
/bin/mount -n -o nocheck,ro /dev/hda4 /drive0
/bin/mount -n -o nocheck,ro /dev/hdc4 /drive1
inetd &
/empeg/bin/player


ftpd works fine, but I loose the bash shell through the serial port, and nothing more comes out of the serial port.. BUT I can still send commands .. (i.e., typing q drops out of the player, but I still can't do anything at that stage...)
Also, typing q kills the ftp daemon..

Any hints?
-mark

ps - for those interested - ftp speed with player loaded, about 600kb/sec.. ftp speed w/o player loaded, around 1mb/sec...



...proud to have owned one of the first Mark I units

_________________________
http://mvgals.net - clublife, revisited.

Top
#15983 - 30/08/2000 14:25 Re: Setting up ftp [Re: hamzy]
kim
member

Registered: 21/07/1999
Posts: 140
Loc: Helsinki, Finland
I can't see that the ethernet's interrupts are not being serviced since emplode can work when the player is playing.

I think the ethernet interrupts are being serviced regularly and probably don't take a hit of the empeg-player thread scheduling as they are more or less part of the kernel.

I thought that Hugo? said that only 30% of the CPU was being utilized.

Yes, but it still doesn't mean that 70% of the time would be freely available to "normal" processes. I believe the empeg-player utilizes all the CPU power it can get, but in theory it would also work with only ~30% of the total CPU time. Good example is to run "/empeg/bin/player -s- &", leave it background and start typing some shell commands. In worst case, it can take several seconds for the bash shell to get any time beyond the empeg-player.

Of course, all this can be handled properly by modifying the other applications to use real time scheduling also to share the time more equally. Although, the program has to be thought out properly before starting to play with the real time priorities as they can easily lock up the whole empeg quite easily (yes, has happened to me ).

Kim



Top
#15984 - 30/08/2000 14:42 Re: Setting up ftp [Re: kim]
altman
carpal tunnel

Registered: 19/05/1999
Posts: 3457
Loc: Palo Alto, CA
We should also drop in cpu usage with the switch to the new mp3 decoder; at one point we did some tests running only one or two threads with the realtime scheduler, as the rest don't really need it (which would probably make the cpu distribution more even for user tasks).

Interrupt latency doesn't suffer much with the player running, but some of the changes we've done to the kernel (I think in 1.01) help task wakeups, especially during caching, which could be very slow.

Hugo



Top
#15985 - 31/08/2000 20:54 Re: Setting up ftp [Re: hamzy]
jstrain
enthusiast

Registered: 18/08/1999
Posts: 202
Loc: philadelphia pa
ok, after i hosed my empeg royally, i flashed it again, and then it worked again. then i read the directions more carefully :). everything seems to work, but regarding step #9, when i type su ftp, it tells me that there is no such user. any reason for this? pinging an internet address works fine, but i cannot ftp to the loopback address or to the empeg from another machine on the LAN. any ideas? going to work on it some more this weekend, and after that works, the micro http server.

btw hamzy, thanks an awful lot. i know enough linux to get by, but i could have never done all that without your directions. it would really be nice to see about getting this turned into a FAQ. tony, are you listening???

jeremy

12 gig, green...

Edited by jstrain on 1/9/00 04:54 AM.

_________________________
12 gig, green...

Top
#15986 - 31/08/2000 21:13 Re: Setting up ftp [Re: jstrain]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31601
Loc: Seattle, WA
tony, are you listening?

Always. But the person to talk to about an FTP-on-Empeg FAQ is Dionysus. Seeing as how I don't have an ethernet-capable Mk2 to try it on...

___________
Tony Fabris
_________________________
Tony Fabris

Top
#15987 - 01/09/2000 06:14 Re: Setting up ftp [Re: tfabris]
dionysus
veteran

Registered: 16/06/1999
Posts: 1222
Loc: San Francisco, CA
It's in the works; I'm just trying to get a few more network services running (such as http and telnet) before posting it...

As for step 9, did you remember to untar the stuff file? untar the stuff.tar file linked above such as this:
tar -xzpvf fielnameforstuff.tar /

...Specifically, this replaces the /etc/passwd and the /etc/group files, which need to reflect the proper ftp account...
-mark

...proud to have owned one of the first Mark I units
_________________________
http://mvgals.net - clublife, revisited.

Top
#15988 - 01/09/2000 15:40 Re: Setting up ftp [Re: hamzy]
Blacksun
new poster

Registered: 01/05/2000
Posts: 17
Hi all ...

Really good work hamzy!!

I have a problem with the ftpd. I added a user administrator and a corresponding group administrator. My ftp user is now a kind of guest account and my administrator user doesn't have access to the ftp server "530 User administrator access denied.".
Probably this is a simple switch to do in a config file, but I didn't see anything I can do to let the administrator and the ftp user login as simple ftp session. In the bash shell i can do a su with ftp and administrator.

Any hint's ??

regards Mirko


.: <a href="www.buholzer.com/mirko">http://www.buholzer.com/mirko</a>
_________________________
.: i love my empeg!!

Top
#15989 - 02/09/2000 14:59 Re: Setting up ftp [Re: Blacksun]
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
Strangely enough (and this is strange), you will get that error if the file /etc/shells does not exist.
Copy that file from the Debian root environment.

I found that out by searching for:
   debian 530 User access denied.


This should be included in the eventual FAQ if there ever is one...

Edited by hamzy on 2/9/00 11:00 PM.


Top
#15990 - 02/09/2000 15:07 Re: Setting up ftp [Re: jstrain]
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
The user has to exist in the /etc/passwd file.

Check out this and this for more information.

Note: Since passwords are encrypted in these files, if you see something simple like "*" or "!", then this means that that user/group cannot use it. This is because the encrypted password will never equal to "*" or "!".


Top
#15991 - 03/09/2000 13:39 Re: Setting up ftp [Re: hamzy]
Blacksun
new poster

Registered: 01/05/2000
Posts: 17
Great it works.
How comes that only I had this problem?

.:Mirko

.: i love my empeg!!
_________________________
.: i love my empeg!!

Top
#15992 - 03/09/2000 18:36 Re: Setting up ftp [Re: Blacksun]
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
'cause you're special


Top
#15993 - 05/09/2000 20:20 Re: Setting up ftp [Re: hamzy]
dionysus
veteran

Registered: 16/06/1999
Posts: 1222
Loc: San Francisco, CA
one small problem.. Anonymous ftp is enabled by default.. D'oh
-mark

MK2: 36gb
Tivo: 90gb
CPU: 120gb
...I think drive manufacturers love me!
_________________________
http://mvgals.net - clublife, revisited.

Top
#15994 - 05/09/2000 20:57 Re: Setting up ftp [Re: dionysus]
dionysus
veteran

Registered: 16/06/1999
Posts: 1222
Loc: San Francisco, CA
problem fixed:) make new user, make file /etc/shells which includes /bin/bash .
-=mark

MK2: 36gb
Tivo: 90gb
CPU: 120gb
...I think drive manufacturers love me!
_________________________
http://mvgals.net - clublife, revisited.

Top
#15995 - 06/09/2000 07:36 Re: Setting up ftp [Re: dionysus]
ClemsonJeep
enthusiast

Registered: 09/11/1999
Posts: 398
Loc: Ashburn, VA
ftpd works fine, but I loose the bash shell through the serial port, and nothing more comes out of the serial port.. BUT I can still send commands .. (i.e., typing q drops out of the player, but I still can't do anything at that stage...)

Also, typing q kills the ftp daemon..


As for the q killing the ftp daemon, I'm not sure what that is about. But you should try running /bin/sh or bash after the player exits, otherwise you won't have a shell. And you also might need to put a loop in it so when the shell exits it jumps back up and reruns /empeg/bin/player.

I haven't tried this yet, but just some ideas..

(O|||||O)

_________________________
(O|||||O)

Top
#15996 - 09/09/2000 16:22 Re: Setting up ftp [Re: hamzy]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
I'm trying to get this to work... I need to install a PPP kernel right? The problem I'm having is that I got the PPP kernel from the developer site but it doesn't work. In fact, I've tried installing it twice and it's rendered my Empeg inoperable both times (I had to re-load the developer image to get it to work again.) So, what am I doing wrong?

-Tony

---
MkII 080000554
_________________________
- Tony C
my empeg stuff

Top
#15997 - 09/09/2000 23:15 Re: Setting up ftp [Re: tonyc]
dionysus
veteran

Registered: 16/06/1999
Posts: 1222
Loc: San Francisco, CA
no; you don't need to setup ppp - that's only for the mk1... Follow the above directions to the letter, and you should get it working.. I'm working on a quick run-this-and-it'll-work solution as well, so stay tuned if you can't get it working..
-mark

MK2: 36gb
Tivo: 90gb
CPU: 120gb
...I think drive manufacturers love me!
_________________________
http://mvgals.net - clublife, revisited.

Top
#15998 - 10/09/2000 17:29 Re: Setting up ftp [Re: hamzy]
sc400
stranger

Registered: 09/09/2000
Posts: 42
Loc: SC
Do I need a user ftp to make ftp and ftpd work? I have chrooted to my debian directory and fixed the etc/hosts.deny file, and ran inetd. No problem up to that point. But when I ftp to the empeg, I get a connected response, then it just hangs. If the fact that I don't have a user ftp is the problem, how should I fix that? If thats not the problem, any ideas on what else I could try?


P.S. I don't even get a login prompt.

Edited by sc400 on 11/9/00 01:30 AM.


Top
#15999 - 10/09/2000 20:51 Re: Setting up ftp [Re: sc400]
dionysus
veteran

Registered: 16/06/1999
Posts: 1222
Loc: San Francisco, CA
You don't need to chroot to the debian environment to get ftp working - just follow Hamzy's instructions... basically, what he's doing is giving you a file called stuff.tar which contains a list of files that need to be extracted from the debian root - the tar command he gives on step 4, specifically the -T tmp/filelist parameter, tells tar to just untar the files in the file list...

If you find it difficult after following hamzy's intructions, let me know and I'll try to hurry up w/ my installer script:)
-mark

MK2: 36gb
Tivo: 90gb
CPU: 120gb
...I think drive manufacturers love me!
_________________________
http://mvgals.net - clublife, revisited.

Top
#16000 - 11/09/2000 13:41 Re: Setting up ftp [Re: sc400]
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
That is most likely a invalid dns setup. Make sure that your /etc/resolv.conf is correct. Test it with ping www.empeg.com from with the empeg.

If you would have waited long enough, you would have gotten a response with incorrect dns.


Top
Page 1 of 2 1 2 >