6

I'm on Ubuntu 15.04 and I just installed vsftpd. When I run the command service vsftpd status, I get the following output:

vsftpd.service - vsftpd FTP server
  Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor   preset: enabled)
Active: failed (Result: exit-code) since Fri 2015-10-09 19:18:50 IST;  3min 11s ago
Process: 2981 ExecStart=/usr/sbin/vsftpd /etc/vsftpd.conf (code=exited, status=2)
Process: 2979 ExecStartPre=/bin/mkdir -p /var/run/vsftpd/empty (code=exited, status=0/SUCCESS)
Main PID: 2981 (code=exited, status=2)

Oct 09 19:18:50 harshal-Lenovo-B40-70 systemd[1]: Starting vsftpd FTP  server...
Oct 09 19:18:50 harshal-Lenovo-B40-70 systemd[1]: Started vsftpd FTP server.
Oct 09 19:18:50 harshal-Lenovo-B40-70 systemd[1]: vsftpd.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Oct 09 19:18:50 harshal-Lenovo-B40-70 systemd[1]: Unit vsftpd.service entered failed state.
Oct 09 19:18:50 harshal-Lenovo-B40-70 systemd[1]: vsftpd.service failed.

I checked /etc/vsftpd.conf, it exists and I did not find anything wrong in it. How can I solve this?

14

I had the same symptoms while trying to start vsftpd on an Ubuntu 16.04. In my case it was enough to comment out this line in /etc/vsftpd.conf:

listen_ipv6=YES

I don't know why i does not work with ipv6 for me, but I have no need for IP-v6 and disabling it solved the problem in my case.

| improve this answer | |
  • Setting up C.H.I.P here. This did the trick! – Codism May 24 '17 at 4:00
8

step 1 : check the vsftpd.conf

listen=YES
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem

Step 2 : To View which ftp service is running use

$ lsof -i | grep ftp

step 3 : To stop xinetd

$ sudo service xinetd stop

Step 4: After stoping xinetd restart your vsftpd service by typing

$ /etc/init.d/vsftpd restart
| improve this answer | |
  • Replaced my vsftpd.conf file with contents of Step1 & the issue was resolved. Thanks – Amandeep Singh Dec 16 '16 at 17:25
3

This can be fixed by commenting out:

listen_ipv6=yes

and I am now active on vsftpd.

| improve this answer | |
2

In addition to some of the other solutions (listen_ipv6=NO and listen=YES), mine was failing with the same error because I had included comments after the things I had modified:

listen_ipv6=NO  # modified

That was also causing the same status=2/INVALIDARGUMENT error. Could only figure it out by running the daemon directly:

$ sudo /usr/sbin/vsftpd /etc/vsftpd.conf 
500 OOPS: bad bool value in config file for: listen_ipv6

Neither systemctl/service nor /var/log/vsftpd.log were any use.

Solution was to remove the trailing comment:

listen_ipv6=NO
| improve this answer | |
0

None of these solutions worked for me. I even have SELinux disabled so that was not the cause and the config file for vsftpd is 100% perfect because service vstfpd start works instantly but it just would not start at startup.

My final solution was this bash script which runs with cron continually checking the service and works perfectly now and starts vsftp on startup by checking and seeing the service is dead and then starting it.

#!/bin/bash
service=vsftpd

if (( $(ps -ef | grep -v grep | grep $service | wc -l) > 0 ))
then
echo "$service is running!!!"
else
service vsftpd start
fi

And then my cron is

* * * * * sudo /usr/sbin/startvsftpd.sh
| improve this answer | |
0

vsftpd needs the /etc/vsftpd.conf to be owned by root. Check who owns it with

ls -la /etc

To change the owner run the following command as as root or via sudo

chown root /etc/vsftpd.conf
| improve this answer | |
-1

You can see /etc/vsftpd.conf. This file configuration Listen=YES,If you setting,,You use vsftpd start serivce. You can try. I have encountered this problem, I was so resolved, I hope you can help.

| improve this answer | |
  • 1
    Welcome to Ask Ubuntu! I recommend editing this answer to expand it with specific details about how to do this. (See also How do I write a good answer? for general advice about what sorts of answers are considered most valuable on Ask Ubuntu.) – David Foerster Jan 8 '16 at 13:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.