问题

  1. 下午的时候突然发现一个服务器上FTP没办法使用了。连接时提示

    Proftpd[12087]:waring: unable to determine IP address of 'Adex'.
    Proftpd[12087]:error: no valid servers configured 'Adex'
    Porftpd[12087]:Fatal: error processing configuration file '/etc/proftpd.conf' fail!
    
  2. 错误还是看的很清楚的嘛,肯定有前辈踩过的坑。

大百度输入错误的代码

  1. 先实验了主机名和IP解析没有对应这个办法。修改了proftpd.conf and /etc/hosts
  2. 然后开始了第二个错误。

    Proftpd socket operation on non-socket
    
  3. 大百度前三页都没有这个错误。wtf

google一下

  • Proftpd error: fatal: Socket operation on non-socket按照这篇blog说问题出在ServerType
  • 查看了一下自己的conf确实模式也是inetd。而不是standalone
  • 官方文档确实也说道这一点

    5. "Fatal: Socket operation on non-socket"
        You have ProFTPD configured to run in inetd mode rather than standalone. In this mode, ProFTPD expects that it will be run from the inetd super-server, which implies that stdin/stdout will be sockets instead of terminals. As a result, socket operations will fail and the above error will be printed. If you wish to run ProFTPD from the shell, in standalone mode, you'll need to modify your proftpd.conf configuration file and add or edit the ServerType directive to read:
        ServerType standalone
    
  • 然后倒是不报错了,但是启动之后什么反应都没有了。

    ps aux|grep proftpd
    hostname -f
    
  • 确认已经没有进程,并且已经确认已经bind了对外IP.

    lsof -i:21 
    
  • 看到inetd 还在,就尝试重启inetd服务。

    /usr/sbin/proftpd 
    
  • 仍旧没有任何反应。
  • 查日志

    vi /var/log/proftpd.log
    没有任何记录。
    
  • 基本束手无策

然后突然间

  • 尝试在服务器上ping了百度。结果发现不同。

    vi /etc/resolv.conf
    
    # 
    #
    search xxx.com
    nameserver 8.8.8.8
    
  • DNS竟然是google的。服务器在国内。然后找了几个运行商的DNS换了一下。

  • ping百度。然后尝试着启动下服务,结果就好了。
  • /etc/resolv.conf看了半天,也只知道它的用处,但是还是不知道为啥。
  • 总之,一个奇怪的solution

大致如此。