我无法在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 ~
我可能会错过什么?