vsftpd and nasty ‘vsftpd failed – probably invalid config.’ error

If you have encountered this sort of issue

 * Starting FTP server vsftpd
 * vsftpd failed - probably invalid config.

try this one. Inside /etc/init.d/vsftpd replace these lines

  start-stop-daemon --start --background -m ...

  n=0
  while [ ${n} -le 5 ]

with this one

  start-stop-daemon --start --background -m ...

  sleep 1  # this one, will remove race condition

  n=0
  while [ ${n} -le 5 ]

I have spent few hours to resolve this one ;)