# mfs_ftp not working



## Soapm (May 9, 2007)

I had a VAR wipe so had to reinstall MFS_FTP. I am close but I need help getting it stabilized..

Initially after install I was able to do a "ps ax | grep mfs_ftp"

And was getting


```
FamRoom-bash# ps ax | grep mfs_ftp
22544 ttyp0 D 1:52 /tvbin/tivosh /var/hack/mfs_ftp/mfs_ftp.tcl 3105 backgrounded
22545 ttyp0 S 0:00 /tvbin/tivosh /var/hack/mfs_ftp/mfs_ftp.tcl 3105 backgrounded
22546 ttyp0 S 0:00 /tvbin/tivosh /var/hack/mfs_ftp/mfs_ftp.tcl 3105 backgrounded
22547 ttyp0 S 0:00 /tvbin/tivosh /var/hack/mfs_ftp/mfs_ftp.tcl 3105 backgrounded
22571 ttyp0 S+ 0:00 grep mfs_ftp
```
So I assumed it was running. But I was getting "connection refused" when I tried to connect to port 3105 with FlashFXP.

I was getting the same via IE using ftp://192.168.254.105:3105/

Then I noticed it kept shutting it self down. Here is the log from FlashFXP where it shuts down.


```
[R] Connecting to mfs_ftp -> IP=192.168.254.105 PORT=3105
[R] Connection failed (Connection refused)
[R] Delaying for 120 seconds before reconnect attempt #1
[R] Connecting to mfs_ftp -> IP=192.168.254.105 PORT=3105 (attempt # 1)
[R] Connection failed (Connection refused)
[R] Delaying for 120 seconds before reconnect attempt #2
[R] Connecting to mfs_ftp -> IP=192.168.254.105 PORT=3105 (attempt # 2)
[R] Connection failed (Connection refused)
[R] Delaying for 120 seconds before reconnect attempt #3
[R] Connecting to mfs_ftp -> IP=192.168.254.105 PORT=3105 (attempt # 3)
[B][R] Connected to mfs_ftp
[R] 220 Mfs_Ftp ver 1.2.9p-patchlevel-20070717b - {sock22} from "192.168.254.103:52942"[/B]
[R] USER anonymous
[R] 331 User name okay, need password.
[R] PASS (hidden)
[R] 230 Running in TiVo Mode.
[R] SYST
[R] 215 UNIX
[R] FEAT
[R] 502 Command not implemented "FEAT"
[R] REST 100
[R] 350 Restart okay, awaiting file request.
[R] REST 0
[R] 350 Restart okay, awaiting file request.
[R] PWD
[R] 257 "/" is current directory.
[R] TYPE A
[R] 200 Type set to I
[R] PASV
[R] 227 Entering Passive Mode (192,168,254,105,12,32).
[R] Opening data connection IP: 192.168.254.105 PORT: 3104
[R] LIST -al
[R] 150 Opening ASCII mode data connection for file list.
[R] 226 Transfer complete.
[R] List Complete: 524 bytes in 0.53 seconds (1.0 KB/s)
[R] CWD tmf
[B][R] Connection lost: mfs_ftp[/B]
[R] Connecting to mfs_ftp -> IP=192.168.254.105 PORT=3105
```
Now I can't get it to start anymore. Here is the error when I try to start it.


```
FamRoom-bash# /var/hack/mfs_ftp/mfs_ftp.tcl
couldn't write file "/var/hack/mfs_ftp/port.3105.log": read-only file system
    while executing
"exec $info(path)/mfs_ftp.tcl $info(port) backgrounded >$info(path)/port.$info(port).log &"
    (procedure "background" line 6)
    invoked from within
"background"
    (procedure "init_procs" line 3)
    invoked from within
"init_procs"
    (file "/var/hack/mfs_ftp/mfs_ftp.tcl" line 1567)
```
Any ideas what I can do to get this working?


----------



## mr.unnatural (Feb 2, 2006)

Yes. You can try posting your question in the forum that actually supports mfs_ftp. Hint: It's not the TCF.


----------



## Soapm (May 9, 2007)

mr.unnatural said:


> Yes. You can try posting your question in the forum that actually supports mfs_ftp. Hint: It's not the TCF.


I did, no help yet...


----------



## mr.unnatural (Feb 2, 2006)

Did you look in /var to see if the /var/hack/mfs_ftp folder still exists? Tivos have a habit of wiping the /var partition, which is why it's not always advisable to install anything there. I believe the only rationale for using /var is because it's not write protected (i.e., read only).


----------



## Wil (Sep 27, 2002)

Soapm said:


> Any ideas what I can do to get this working?


Mfs_ftp.tcl as you know has not been updated in years, and its author will not allow anyone to offer a corrected version. So it has to be installed very carefully and patched only with a few of the myriad of patches around, and those in the right sequence. The binaries have to replaced with current ones, and there is special handling required for the import function.

A good install sequence and description of sources is here:
dvrpedia[dot]com[slash]MFS_FTP

Ignore the later sections on surviving a var wipeout; they are full of errors. BTW I suspect that one of your problems is your log (actual file) is not in var and there's a symbolic reference to it, but anyway...

My install is a little different, if you know what you're doing (this is from memory).

Do a basic mfs_ftp.tcl version 1.2.9p (which you seem to have) install exactly as described in the author's readme. I assemble and unpack all the other source pieces on my pc. Replace bins with Jamie's latest mips bin package. Transfer and apply the three patches as described and in the order described in dvrpedia. Some versions of the Tivo-resident patch command are said to be faulty. If you have reason to think you have a faulty command file, install a current one. There are two other patches that just need to be transferred, not applied, p1 and p2. Transfer a current tzoffset (and a data file if you wish). Use either rename or a symbolic link to handle the current import issue. One of the patches requires that the settings file be edited; instructions are within the patch text as I recall. There are a couple of empty subdirectories and symlinks which might need special manual handling; this is one reason dvrpedia suggests unpacking everything on the Tivo, but these are trivial to do manually if you just look at the collection of files and subdirectories needed in the end. Chmod everything to be executable. Put a startup command in rc.sysinit.author.

A lot of people say make sure your ftp client is set to be passive; my understanding and experience say just the opposite, but try both if you want and see what happens since it might depend on your individual firewall situation.

EDITED TO ADD: The most important factor in my experience, on my machines and helping many others, is to have know good virgin pieces of everything to start with. There are copies of everything around, and some are corrupt, especially stuff you may have collected on your own computer. Get everything fresh and new and keep them in a locked folder. Modify copies only, keep those sources pure for retries and future installs if var gets wiped.


----------



## lew (Mar 12, 2002)

> couldn't write file "/var/hack/mfs_ftp/port.3105.log": read-only file system


This gives you a clue as to at least one of your problems. Do a search in the other forum.


----------



## Wil (Sep 27, 2002)

lew said:


> This gives you a clue as to at least one of your problems. Do a search in the other forum.


But it's only one, which is why I think a careful re-install is the best course.

Searching is always a good idea though.


----------



## Soapm (May 9, 2007)

Wil said:


> BTW I suspect that one of your problems is your log (actual file) is not in var and there's a symbolic reference to it, but anyway....


There you go, I used Sapper to hack my Tivo so mfs_ftp is actually installed in the /enhancements/varhacks/hack/mfs_ftp/ then I create symlinks to the VAR directory.

So I guess my question is how do I remove the symlink for this file then create a log file in the correct folder in my VAR directory?

I know to create the file is touch port.3105.log while in the directory. But I can't seem to get rid of the file that is symlinked to the directory.

PS.. could it also be that the folder, mfs_ftp is actually symlinked that I can't seem to create a readable file in the folder?


----------

