Hello everyone! I repost this from bsdforums.org following the advice of moderator.
I've got the following problem and wonder if someone could help.
I have FREEBSD6.3-STABLE box. There is a jail in which vsftpd v2.0.6 runs.
The trouble is that vsftpd stucks after the upload is finished. Download is ok. Typical ftp session looks like this:
Code:
>ftp host.biz
Connected to host.biz.
220-********************************
220-Welcome to Host.Biz FTP site!
220-********************************
220
Name (host.biz:sunny): sunny
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
Remote directory: /usr/home/sunny
ftp> ls
500 EPSV command not understood
227 Entering Passive Mode (X,X,X,X,199,97)
150 Here comes the directory listing.
drwxr-xr-x 2 sunny sunny 512 Dec 11 2006 bin
-r-xr--r-- 1 sunny sunny 4686 Dec 11 2006 change_rules.sh
226 Directory send OK.
ftp> send
(local-file) incoming/ff.png
(remote-file) ff.png
local: incoming/ff.png remote: ff.png
227 Entering Passive Mode (X,X,X,X,243,220)
150 Ok to send data.
100% |*************************************| 253 KB 34.79 KB/s 00:00 ETA
421 Service not available, remote server timed out. Connection closed
259195 bytes sent in 01:07 (3.76 KB/s)
ftp> quit
While vsftpd hangs before timeout, in top it is shown as:
Code:
PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND
9881 sunny 1 4 0 2976K 1544K soclos 1 0:00 0.00% vsftpd
There is ftp-proxy with pf in front of vsftpd. However, i tried without it - the same. The fact is that on another machine with 6.3-STABLE and same version of vsftpd (but non-jailed) all is ok!
I've found a place in code which causes stuck - it is on close() call on data channel socket with SO_LINGER option set. Google didn't tell anything and
I have no clue why this happens.
Could anyone help?
Thanx in advance.