LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-28-2013, 11:25 AM   #1
larrybg
Member
 
Registered: Aug 2013
Posts: 31

Rep: Reputation: Disabled
pure-ftpd upload scrip not working


Hi everyone,

I need a help with the pure-ftpd upload script. I installed pure-ftpd server on the redhat server using these instructions: https://systemlog.info/setup-pure-ftpd-on-centos-6-4/
, and configure it to run an upload script. The same script works on the old server that I'm moving away from (I didn't setup that one). The script only moves uploaded files from the upload directory to another, and it doesn't work on the new server. Not sure why or how to troubleshoot it.
 
Old 10-29-2013, 03:46 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Hi,

Check if pure-uploadscript is running:
Code:
ps -ef|grep  pure-uploadscript
Regards
 
Old 10-29-2013, 10:14 AM   #3
larrybg
Member
 
Registered: Aug 2013
Posts: 31

Original Poster
Rep: Reputation: Disabled
here is the output:

Quote:
# ps -ef|grep pure-uploadscript
500 2190 1 0 13:27 ? 00:00:00 /usr/sbin/pure-uploadscript -r /etc/pure-ftpd/processUpload.sh -B -u 500
root 2288 1948 0 13:29 pts/0 00:00:00 grep pure-uploadscript
 
Old 10-29-2013, 04:54 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Quote:
here is the output:

Quote:
# ps -ef|grep pure-uploadscript
500 2190 1 0 13:27 ? 00:00:00 /usr/sbin/pure-uploadscript -r /etc/pure-ftpd/processUpload.sh -B -u 500
root 2288 1948 0 13:29 pts/0 00:00:00 grep pure-uploadscript
Check if /var/run/pure-ftpd.upload.pipe, /var/run/pure-ftpd.upload.lock exist, meaning that pure-ftpd is configured correctly to run the upload script
In this case it could be that the uid=500 cannot move files in the destination directory, or SELinux prevents the script from running.
 
Old 10-29-2013, 08:03 PM   #5
larrybg
Member
 
Registered: Aug 2013
Posts: 31

Original Poster
Rep: Reputation: Disabled
Hi bathory,
I will check tomorrow and post about pipe and locker, and disable SELinux, but what is it about uid=500 so special?
 
Old 10-30-2013, 09:51 AM   #6
larrybg
Member
 
Registered: Aug 2013
Posts: 31

Original Poster
Rep: Reputation: Disabled
Hi bathory,
pure-ftpd.upload.lock and pure-ftpd.upload.pipe are exists under /var/run/. I also disabled SELinux. Still don't have any results...
 
Old 10-30-2013, 10:13 AM   #7
larrybg
Member
 
Registered: Aug 2013
Posts: 31

Original Poster
Rep: Reputation: Disabled
the output from production box a little different:

Quote:
ps -ef|grep pure-uploadscript
500 2815 1 0 Oct24 ? 00:00:00 /usr/sbin/pure-uploadscript -r /etc/pure-ftpd/processUpload.sh -B -u 500 > /dev/null
root 20064 20020 0 11:11 pts/0 00:00:00 grep pure-uploadscript
 
Old 10-30-2013, 11:43 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Add before anything else in your script:
Code:
echo "$1 uploaded" >> /tmp/pure.log
to see if something is written in the log.

Quote:
what is it about uid=500 so special?
Nothing special. Just check if a user with uid=500 exists and has write permissions in the destination directory
 
Old 10-30-2013, 11:57 AM   #9
larrybg
Member
 
Registered: Aug 2013
Posts: 31

Original Poster
Rep: Reputation: Disabled
I added that line, restarted service and nothing. script didn't create the file.
 
Old 10-30-2013, 12:13 PM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Quote:
Originally Posted by larrybg View Post
I added that line, restarted service and nothing. script didn't create the file.
You need to upload a file and see what you get...
 
Old 10-30-2013, 12:47 PM   #11
larrybg
Member
 
Registered: Aug 2013
Posts: 31

Original Poster
Rep: Reputation: Disabled
yes, I understand that. After uploading a file script didn't create anything, and uploaded file sits in the ftp home directory. So, no /tmp/pure.log after upload
 
Old 10-30-2013, 01:11 PM   #12
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Quote:
Originally Posted by larrybg View Post
yes, I understand that. After uploading a file script didn't create anything, and uploaded file sits in the ftp home directory. So, no /tmp/pure.log after upload
Are you sure the script is executable?
Run
Code:
chmod +x /etc/pure-ftpd/processUpload.sh
and test again.
 
Old 10-30-2013, 01:21 PM   #13
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
any reason why you dont just use scp. seems like not olny it would be easier but more secure (with ssh keys).
 
Old 10-30-2013, 01:36 PM   #14
larrybg
Member
 
Registered: Aug 2013
Posts: 31

Original Poster
Rep: Reputation: Disabled
...mystery... run the command, rebooted, tried to upload script -> nothing...
 
Old 10-30-2013, 02:24 PM   #15
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Quote:
Originally Posted by larrybg View Post
...mystery... run the command, rebooted, tried to upload script -> nothing...
No need to reboot. Anyway what happens if you run the script alone, like
Code:
/etc/pure-ftpd/processUpload.sh test
where test is a test file
 
  


Reply

Tags
script, upload


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] My pure-ftpd FTP won't let me upload files back to it. timebirds Linux - Newbie 8 03-13-2012 07:59 PM
pure-ftpd passive transfers not working kevincw01 Linux - Networking 5 06-06-2010 07:05 PM
Pure-ftpd - how to disallow download and allow only upload. anandkj Linux - Software 1 04-02-2009 04:03 AM
pure-ftpd-mysql activates pure-ftpd zvikamer Linux - Software 2 03-01-2008 12:11 PM
Pure-ftpd closes connection after 10 minutes of upload steelliberty Linux - Networking 2 07-23-2007 08:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration