1

I am using the apt-get install the pure-ftp on ubuntu server 14.04.4

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

the hell.sh file, and it's able to run.

#!/bin/sh
echo "hello"

Then, I use FileZilla to upload the file. I can upload the file, but the script is not called. please help;

John Zhang
  • 381
  • 1
  • 3
  • 22

2 Answers2

0

official doc

If you install the pure-ftpd server by apt-get, it may not give you the feature that you want to use. I checked the /var/run folder, some file are missing there. I complied the code with --with-uploadscript, it's working now.

John Zhang
  • 381
  • 1
  • 3
  • 22
0

I had to also compile from source, fortunately the install is not too heavy. It may be worth uploading the compiled files from your system to your mirror and just downloading and running make install. On the other hand, this works as well:

- 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
radtek
  • 34,210
  • 11
  • 144
  • 111