PDA

View Full Version : Never ending proftpd issues



FishStick
12-02-2008, 12:44 PM
Ever since I moved one of the existing users from shared IP to his own I've had unknown issues with proftpd. Today I added a new user to DA with his own IP and proftpd crashed again.

Anyway, rebuilt with the rc2. Getting me nowhere:


test -z """" || (cd locale/ && make install)
Done proftpd.
Restarting ProFTPd.
Shutting down proftpd: /etc/init.d/proftpd: line 36: kill: (1940) - No such process
Starting proftpd:


Nothing happens :|


zeus:/usr/local/directadmin/custombuild# /etc/init.d/proftpd start
Starting proftpd:
zeus:/usr/local/directadmin/custombuild# ps aux | grep proftpd
root 2612 0.0 0.0 1640 528 pts/0 S+ 12:19 0:00 grep proftpd
zeus:/usr/local/directadmin/custombuild#



Dec 2 12:14:11 zeus proftpd[2492]: nicx.no - ProFTPD 1.3.2rc1 (devel) (built Tue Dec 2 12:11:49 PST 2008) standalone mode STARTUP
Dec 2 12:14:11 zeus proftpd[2492]: nicx.no - unable to listen on 0.0.0.0#21: Address already in use


^ my conf file isn't even set to the default port (21), it's custom (due to ftp brute forcing).

Anyone got some tips?

scsi
12-02-2008, 01:48 PM
Then you either have a 2nd proftpd installed or its calling the wrong config file. What method are you using to reinstall proftpd?

FishStick
12-02-2008, 02:13 PM
Hi scsi :)

Thanks for the reply. I used this method for upgrading to rc2:


cd /usr/local/directadmin/custombuild
./build update
wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.2rc1.tar.gz
perl -pi -e 's#proftpd:1.3.1:3eab497e5d3a50ff012cac6759127cf8#proftpd:1.3.2rc1:e017918f5dcbb58b1de159a162fc796a#' versions.txt
./build proftpd

I'm sure you're right. Here's my previous history with proftpd:


cd /usr/local/directadmin/scripts/
ls
./proftpd.sh



cd ~
wget http://files.directadmin.com/services/customapache/proftpd-1.3.1.tar.gz
tar xvzf proftpd-1.3.1.tar.gz
cd proftpd-1.3.1
install_user=ftp install_group=ftp ./configure --prefix=/usr/local --sysconfdir=/etc --localstatedir=/var/run --mandir=/usr/local/man --without-pam --disable-
auth-pam --with-modules=mod_ratio:mod_readme LDFLAGS=-static
make
make install
rm -f /usr/local/etc/proftpd.conf
ln -s /etc/proftpd.conf /usr/local/etc/proftpd.conf
telnet localhost 221
telnet localhost 21

scsi
12-02-2008, 02:22 PM
You can check for multiple versions of proftpd with:

which -a proftpd

I also think the directadmin versions of proftpd are a little different then the default ones.

It might just be the init file causing problems.

FishStick
12-02-2008, 02:35 PM
zeus:~# which -a proftpd
/usr/local/sbin/proftpd
/usr/sbin/proftpd
zeus:~#


Look at that :confused:

Which should I remove, and how?

scsi
12-02-2008, 02:38 PM
What os do you use?

FishStick
12-02-2008, 02:40 PM
Debian,


zeus:~# uname -a
Linux zeus.aim.no 2.6.18-6-686 #1 SMP Tue Jun 17 21:31:27 UTC 2008 i686 GNU/Linux
zeus:~#


Thanks for your assistance btw :)

scsi
12-02-2008, 02:40 PM
What is output of this command:

rpm -qa | grep -i proftpd

FishStick
12-02-2008, 02:43 PM
zeus:~# rpm -qa | grep -i proftpd
-bash: rpm: command not found


I don't use rpm, though I have apt installed.

scsi
12-02-2008, 02:45 PM
Ok you must be on debian then:

apt-get remove proftpd
apt-get purge proftpd

If that doesnt do anything then you must have them both installed via source.

FishStick
12-02-2008, 02:50 PM
zeus:~# apt-get remove proftpd
Reading package lists... Done
Building dependency tree... Done
The following packages will be REMOVED:
proftpd
0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 25797 files and directories currently installed.)
Removing proftpd ...

zeus:~# apt-get purge proftpd
E: Invalid operation purge

zeus:~# which -a proftpd
/usr/local/sbin/proftpd
zeus:~#


Only one now :D :eek:

DA won't start it though. Let me check the logs.

scsi
12-02-2008, 02:52 PM
Check /var/log/messages after trying to start it... If not then

cd /usr/local/directadmin/custombuild
./build clean
./build proftpd

FishStick
12-02-2008, 02:55 PM
Dec 2 14:30:18 zeus -- MARK --


messages empty...


zeus:~# /etc/init.d/proftpd start
Starting proftpd: /etc/init.d/proftpd: line 28: /usr/sbin/proftpd: No such file or directory


Incorrect location in init.d - duplicated PATH and BINARY and updated, nulled original.

These are recent:


Dec 2 14:47:33 zeus proftpd[5492]: nicx.no - ProFTPD 1.3.1 (stable) (built Tue Dec 2 12:02:43 PST 2008) standalone mode STARTUP
Dec 2 14:47:33 zeus proftpd[5492]: nicx.no - unable to listen on 0.0.0.0#21: Address already in use
Dec 2 14:48:01 zeus /USR/SBIN/CRON[5547]: (root) CMD (/usr/local/directadmin/dataskq)
Dec 2 14:48:01 zeus proftpd[5551]: nicx.no - ProFTPD 1.3.1 (stable) (built Tue Dec 2 12:02:43 PST 2008) standalone mode STARTUP
Dec 2 14:48:01 zeus proftpd[5551]: nicx.no - unable to listen on 0.0.0.0#21: Address already in use
Dec 2 14:48:11 zeus proftpd[5560]: nicx.no - ProFTPD 1.3.1 (stable) (built Tue Dec 2 12:02:43 PST 2008) standalone mode STARTUP
Dec 2 14:48:11 zeus proftpd[5560]: nicx.no - unable to listen on 0.0.0.0#21: Address already in use



cd /usr/local/directadmin/custombuild
./build clean
./build proftpd
...
test -z """" || (cd locale/ && make install)
Done proftpd.
Restarting ProFTPd.
Shutting down proftpd: /etc/init.d/proftpd: line 38: kill: (15439) - No such process

Starting proftpd:
zeus:/usr/local/directadmin/custombuild#


:|

scsi
12-02-2008, 03:00 PM
What command did you use to try to start it.

/etc/init.d/proftpd start

should work.

You might want to try to start it in no daemon mode to see if there are any errors.

/usr/local/sbin/proftpd -n

FishStick
12-02-2008, 03:14 PM
I used
/etc/init.d/proftpd start and it gave me the error
Starting proftpd: /etc/init.d/proftpd: line 28: /usr/sbin/proftpd: No such file or directory so I updated the path in init.d/proftpd which was set to:


PATH="/usr/sbin" and

BINARY=/usr/sbin/proftpd"

These are now:


#PATH="/usr/sbin"
PATH="/usr/local/sbin" and

#BINARY=/usr/sbin/proftpd"
BINARY=/usr/local/sbin/proftpd"

/usr/local/sbin/proftpd -n gives me


zeus:/usr/local/directadmin/custombuild# /usr/local/sbin/proftpd -n
nicx.no - ProFTPD 1.3.1 (stable) (built Tue Dec 2 12:02:43 PST 2008) standalone mode STARTUP
nicx.no - unable to listen on 0.0.0.0#21: Address already in use
zeus:/usr/local/directadmin/custombuild#


My port in /etc/proftpd.conf is still configured to:


Port 221

So the error above is odd...

scsi
12-03-2008, 07:07 AM
Maybe you have more then one proftpd.conf

find / -name proftpd.conf

Look in the init file again to see what config file it is loading if any.

FishStick
12-03-2008, 09:18 AM
There seems to be several:


zeus:~# find / -name proftpd.conf
/usr/local/directadmin/data/templates/proftpd.conf
/usr/local/etc/proftpd.conf
/etc/proftpd.conf
zeus:~#


Which proftpd.conf is not defined in init. I'll alter the port in all and try again.

scsi
12-03-2008, 09:30 AM
Are

/usr/local/etc/proftpd.conf

and

/etc/proftpd.conf

the same file?

/etc/proftpd.conf should be the one it is calling.

FishStick
12-03-2008, 09:44 AM
Yes, they seem identical. Both are set to port 221 which is the only setting I've altered.

proftpd is online! I nulled out the domain names with owned ip in the proftpd.vhosts.conf and proftpd started up again like that!

Seems like there is a vhost bug in proftpd.. (Still doesn't explain why it puked at error connecting to port 21 when my conf never had that port configured).

There seems to be an issue with adding new ftp accounts to a domain trough DA - I enter username, generate pw, select access path - but the account is not created.