vsftpd quits when there's no working internet connection

Bug #277114 reported by bsh
2
Affects Status Importance Assigned to Milestone
vsftpd (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: vsftpd

on our server i noticed, that randomly, vsftpd wasn't running. i thought it is not being started correctly on boot.
but then i noticed, that after restarting it, and it was working well, then when our internet connection dropped. and during this and after, vsftp daemon wasn't running anymore (locally).
then i tested it and as it turned out, when there is no active internet connection, the vsftp daemon quits pretty soon after it's being started.
i configured it to handle passive mode transfers too (even if i prefer active mode), and i'm reading my wan side ip from a dyndns account. i suspect this may have something to do with this unexpected quitting of the daemon. if it can not reach the dyndns domain, it somehow quits or crashes. however, it shouldn't have to. this ftp server is mainly for internal use, it should keep working locall even if there's no active internet connection.

i have reproduced this as follows:
1, /etc/init.d/vsftpd start
2, ps -ef | grep ftp: vsftpd was running
3, unplug the modem cable from the router (btw, the local network is on a switch, and the switch is on the router)
4, ps -ef | grep ftp: vsftpd wasn't running anymore
5, /etc/init.d/vsftpd start
6, ps -ef | grep ftp: vsftpd was running again
7, wait a few seconds
8, ps -ef | grep ftp: vsftpd was not running
9, replug the modem cable to the router
10, /etc/init.d/vsftpd start
11, ps -ef | grep ftp: vsftpd was running again

there is no log message in /var/log/syslog, /var/log/daemon.log, /var/log/messages, /var/log/vsftp/*, nowehre at all.

i am on ubuntu 7.04, 32 bit generic kernel. vsftpd is installed from the default repository using synaptic.

/etc/vsftpd.conf:

listen=YES
#listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=002
anon_upload_enable=NO
#anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
#chown_uploads=YES
#chown_username=whoever
#xferlog_file=/var/log/vsftpd.log
#xferlog_std_format=YES
idle_session_timeout=600
data_connection_timeout=120
#nopriv_user=ftpsecure
#async_abor_enable=YES
#ascii_upload_enable=YES
ascii_download_enable=YES
ftpd_banner=Welcome to .... FTP service.
#deny_email_enable=YES
#banned_email_file=/etc/vsftpd.banned_emails
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
#ls_recurse_enable=YES
secure_chroot_dir=/var/run/vsftpd
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
userlist_enable=YES
userlist_deny=NO
pasv_enable=YES
pasv_promiscuous=YES
pasv_min_port=25025
pasv_max_port=25099
pasv_addr_resolve=YES
pasv_address=XXXXXX.XXXXXX.org (<- this is a dyndns domain)
max_per_ip=10
hide_ids=YES
use_localtime=YES
max_login_fails=3
delay_failed_login=10

Revision history for this message
Chuck Short (zulcss) wrote :

I am not able to reproduce this using the karmic vsftpd version.

Regards
chuck

Changed in vsftpd (Ubuntu):
status: New → Invalid
Revision history for this message
bsh (bsh) wrote :

after further inspection i came to this:
- i have no local dns server (only a few entries in /etc/hosts, only for the workgroup computers)
- i use the dns provided by the ISP
- pasv_address=... option tries to resolve the given domain name to an IP using dns
- if there's no internet connection for any reason, there's no dns either, so it will fail/timeout
- this crashes(?) vsftpd (or at lest it quits)

so the problem is not "vsftpd quits when there's no working internet connection" anymore, it should be "vsftpd quits when pasv_address= can't resolve to an IP"
(and for me, there's NAT involved too, to make it more complicated)

Revision history for this message
bsh (bsh) wrote :

(oops, there's no edit...?)
i ended up not using pasv_address= option and also made a vsftpd_keepalive script that keeps vsftpd running. (but it's not needed if pasv_address is not in use)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.