cPanel FTP Failed - Unable to connect to port 21 on 127.0.0.1
So I woke up to numerous emails from the cPanel Monitor service telling me that the ftpd service was offline. I tried various ways to restart the service but it just wouldn't start, I kept getting the same error message:
warn [restartsrv_pureftpd] The 'pureftpd' service's PID file '/var/run/pure-ftpd.pid' did not appear after 10 seconds.
Waiting for “pureftpd” to restart …………Waiting for pure-ftpd,pure-authd to shutdown ....... terminated.
warn [restartsrv_pureftpd] The 'pureftpd' service's PID file '/var/run/pure-ftpd.pid' did not appear after 10 seconds.
…warn [restartsrv_pureftpd] The 'pureftpd' service's PID file '/var/run/pure-ftpd.pid' did not appear after 10 seconds.
…failed.
Cpanel::Exception::Services::StartError
Service Status
pure-ftpd (/usr/sbin/pure-ftpd [...]) is running as root with PID 18545 (systemd+/proc check method).
Service Error
(XID fhx2ad) The “pureftpd” service failed to start.
Startup Log
May 24 13:41:45 [...] systemd[1]: Started Pure-FTPd.
May 24 13:41:45 [...] systemd[1]: Starting Pure-FTPd...
pureftpd has failed. Contact your system administrator if the service does not automagically recover.
I checked CSF Firewall to see if that was somehow blocking the port, I updated the server's plugins and ran a manual cpanel upgrade but nothing worked.
Well, it turns out the culpret is an option in the /etc/pure-ftpd.conf config file.
If you're having issues with PureFTPD and cPanel, check if CallUploadScript is set to yes by running this command in shell:
grep Call /etc/pure-ftpd.conf
If you see "CallUploadScript yes" then you need to disable it as it turns out that when trying to start the pureftpd service it attempts to start the pure-uploadscript service but it wont work. Simple fix is:
vi /etc/pure-ftpd.conf
Find the line that says CallUploadScript yes and change it to no.
Restart ftp service and you're good to go!