proftpd keeps crashing or just stops working and I don’t know why

I manage a ftp box at work that takes in screenshots of students laptops that we manage. There are about 500+ images coming in everyday. That’s a ton of data that requires a ftp server that will stay working. Fortunatly because linux is awesome there proftpd, problem is it likes to randomly stop working or crash. I had this issue for a while but with a cool tool I was able to monitor the process and make sure it is always running. If it shuts down it will just start the process again…problem solved.

My original post was on AskUbuntu

Here is how to keep proftpd running

First install monit on your linux box that is running proftpd

Make sure you are all updated

sudo apt-get update
sudo apt-get upgrade

Next install monit on your server

sudo apt-get install monit

Now we are going make a small edit to a monit file

cd /etc/monit/
vi monitrc

In the monitrc file look for this line

set httpd port 2812 and

And change it to

set httpd port 2812

Now un-comment this line

allow admin:monit

Now at the bottom of the file add these 4 lines, change your ftp port number if you have it different than 21

check process proftpd with pidfile /var/run/proftpd.pid
start program = "/etc/init.d/proftpd start"
stop program  = "/etc/init.d/proftpd stop"
if failed port 21 protocol ftp then restart

At the end just restart your service

/etc/init.d/monit restart

Now go to your browser and go to your box domain name like this https://localhost:2812. You are going to have to have apache running on the server since monit shows you the results in the web browser.

Mine is localhost, yours might be something else like example.com

Also keep in mind that you can use this for any process

This is what it will look like

Side Note

If you start the receive a “Execution failed | Does not exist” status in monit then check to make sure that proftpd PID matches in the PID file for proftpd.

First make sure proftpd is running

/etc/init.d/proftpd start

Then type top in terminal and find the PID of proftpd currently running.

Go to /var/run/proftpd.PID and make sure the PID in that file matches the one in top. If it does not then change it in the file and restart monit

/etc/init.d/monit restart