错误:无法打开stdin的/ dev / null:没有这样的文件或目录

时间:2013-01-21 16:36:08

标签: ftp proftpd

我无法在proftpd工作时获得简单的触发器。这是我做的:

 <IfModule mod_exec.c>
  ExecEngine on
  ExecOptions logStderr logStdout
  ExecLog /var/log/proftpd/exec.log
  ExecOnCommand APPE,STOR /usr/local/bin/proftptest.sh %u %f
 </IfModule>

然而它继续失败:

Jan 21 17:31:07 mod_exec/0.9.9[22514]: already saw this Exec, skipping
Jan 21 17:31:07 mod_exec/0.9.9[22514]: already saw this Exec, skipping
Jan 21 17:31:07 mod_exec/0.9.9[22514]: preparing to execute '/usr/local/bin/proftptest.sh' with uid 117 (euid 117), gid 65534 (egid 65534)
Jan 21 17:31:07 mod_exec/0.9.9[22514]:  + '/usr/local/bin/proftptest.sh': argv[1] = ftp
Jan 21 17:31:07 mod_exec/0.9.9[22514]:  + '/usr/local/bin/proftptest.sh': argv[2] = /home/ftp/incoming/Examples.txt
Jan 21 17:31:07 mod_exec/0.9.9[22514]: error: unable to open /dev/null for stdin: No such file or directory
Jan 21 17:31:07 mod_exec/0.9.9[22514]: STOR ExecOnCommand '/usr/local/bin/proftptest.sh' failed: No such file or directory
Jan 21 17:31:07 mod_exec/0.9.9[22514]: already saw this Exec, skipping
Jan 21 17:31:07 mod_exec/0.9.9[22514]: already saw this Exec, skipping

然而,脚本似乎很好(从我的用户会话,默认环境运行):

$ ls -al /usr/local/bin/proftptest.sh
-rwxr-xr-x 1 root root 97 Jan 21 17:25 /usr/local/bin/proftptest.sh

我没有使用DefaultRoot:

$ grep Default /etc/proftpd/proftpd.conf
DefaultServer           on
# DefaultRoot           ~

我可能会错过什么?

1 个答案:

答案 0 :(得分:1)

如文档中所示:

http://www.castaglia.org/proftpd/modules/mod_exec.html#Usage

  

此模块无法正常使用<Anonymous&gt;登录

这个文件的症状,但并没有解决真正的问题,所以转移到不同的ftp服务器......