pure-ftpd 的 pure-uploadscript 不适用于 ubuntu

pure-uploadscript of pure-ftpd is not working on ubuntu

我正在使用 apt-get 在 ubuntu 服务器 14.04.4

上安装 pure-ftp
sudo apt-get install pure-ftpd
sudo pure-uploadscript -B -r /home/john/hello.sh 

hell.sh 文件,它能够 运行。

#!/bin/sh
echo "hello"

然后,我使用FileZilla上传文件。我可以上传文件,但没有调用脚本。请帮忙;

official doc

如果您通过 apt-get 安装 pure-ftpd 服务器,它可能无法提供您想要使用的功能。我检查了 /var/run 文件夹,那里缺少一些文件。我用 --with-uploadscript 编译了代码,它现在可以工作了。

我也不得不从源代码编译,幸运的是安装不是太重。可能值得将已编译的文件从您的系统上传到您的镜像,然后只需下载 运行 make install。另一方面,这也有效:

- name: install pure-ftpd from source
  block:
  - name: create required pure-ftpd dirs
    become: yes
    file:
      path: /etc/pure-ftpd
      state: directory
      owner: root
      mode: 0755
  - name: install deps for building pureftpd
    apt: pkg={{ item }} state=present
    with_items:
      - libssl-dev
      - libpam0g-dev
  - name: download and unpack pure-ftpd source
    unarchive:
      src: http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.49.tar.gz
      dest: /usr/local/src/
      remote_src: yes
      keep_newer: yes
    register: source_unpack
  - name: configuring pure-ftpd source with custom modules
    command: "./configure --prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec
    --datadir=/usr/share --sysconfdir=/etc --sharedstatedir=/usr/com --localstatedir=/var --libdir=/usr/lib64
    --includedir=/usr/include --infodir=/usr/share/info --mandir=/usr/share/man --with-virtualchroot --with-everything
    --with-uploadscript --with-tls --with-pam"
    args:
      chdir: /usr/local/src/pure-ftpd-1.0.49
    when: source_unpack|changed
    register: pure_ftpd_configure
  - name: make and install pure-ftpd
    become: yes
    shell: make && make install
    args:
      chdir: /usr/local/src/pure-ftpd-1.0.49
    when: pure_ftpd_configure|changed
  when: stat_result.stat.exists == False
  tags:
    - ftp