我在ubuntu服务器14.04.4上使用apt-get install pure-ftp
sudo apt-get install pure-ftpd
sudo pure-uploadscript -B -r /home/john/hello.sh
hell.sh文件,它可以运行。
#!/bin/sh
echo "hello"
然后,我使用FileZilla上传文件。我可以上传文件,但不会调用脚本。请帮忙;
答案 0 :(得分:0)
如果您通过apt-get安装pure-ftpd服务器,它可能无法提供您要使用的功能。我检查了/ var / run文件夹,那里缺少一些文件。我用--with-uploadscript编写了代码,它现在正在工作。
答案 1 :(得分:0)
我还必须从源代码进行编译,所幸安装并不算太重。可能值得将编译后的文件从系统上载到镜像,然后下载并运行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