vsftpd does not start at boot time when some options require IP or DNS support
This bug report will be marked for expiration in 52 days if no further activity occurs. (find out why)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
vsftpd (Ubuntu) |
Incomplete
|
Undecided
|
Unassigned |
Bug Description
The current unit section looks like this:
[Unit]
Description
After=
So it means the network should exist, but after network.target, it may not be up and may not have been assigned IP addresses. What works much better is:
[Unit]
Description
Wants=
After=
This change means:
1. the network is up
2. at least one interface has an IP address (apparently we cannot force all interfaces to be ready)
3. the Wants= also ensures that the network-only.target is actually started (in case vsftp.service is the only service that needs the network)
In my case, I have a specific IP address because I want FTP only on my LAN:
listen=YES
listen_
listen_
The failure is the 192.168.203.1. The corresponding interface is not up yet so the bind() fails (at least I would imagine that's the point of failure--I did not confirm that).
There is another case on stackoverflow.com:
https:/
That one uses an address for the passive setup:
pasv_
pasv_
which also fails at boot time because the DNS is not yet ready. In that case, though, maybe it is necessary to start After= the resolver. That would probably be this:
After=
So the final change would be:
[Unit]
Description
Wants=
After=
Version: vsftpd_
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.2 LTS
Release: 24.04
Codename: noble
Hello, @alexis-m2osw, thanks for reporting this issue.
> The failure is the 192.168.203.1. The corresponding interface is not up yet so the bind() fails (at least I would imagine that's the point of failure--I did not confirm that).
Could you please attach relevant logs, so we could be assertive on what exactly is happening?
Which error do you get? Is it 2/INVALIDARGUMENT, as in the stackoverflow post? What is the output of running
/usr/sbin/vsftpd /etc/vsftpd.conf
in the machine?