ProFTPD Update 1.3.4a Segmentation fault

splitech

Verified User
Joined
Sep 28, 2004
Messages
49
Tried to update using custombuild to latest version of proftpd and now segfault.

Done proftpd.
pure-ftpd: no process killed
Restarting ProFTPd.
Shutting down proftpd: cat: /var/run/proftpd.pid: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]

Starting proftpd: server.name.com proftpd[20627]: warning: "ProFTPd" address/port (x.x.x.x:21) already in use by "ProFTPd"
server.name.com proftpd[20627] x.x.x.x: ProFTPD terminating (signal 11)
server.name.com proftpd[20627] x.x.x.x: FTP session closed.
/etc/init.d/proftpd: line 37: 20627 Segmentation fault $BINARY
 
First did "mv /etc/init.d/proftpd /etc/init.d/proftpd.1

Then

No go. Now make on ./build proftpd gets an error.

/bin/sh: line 1: msgfmt: command not found
make[1]: [zh_TW] Error 127 (ignored)

make[1]: Leaving directory `/usr/local/directadmin/custombuild/proftpd-1.3.4a/locale'
update-rc.d: warning: /etc/init.d/proftpd missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
System startup links for /etc/init.d/proftpd already exist.
./build: line 8325: [: missing `]'
Done proftpd.
pure-ftpd: no process killed
Restarting ProFTPd.
Shutting down proftpd: cat: /var/run/proftpd.pid: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]

Starting proftpd: server.name.com proftpd[1839]: warning: "ProFTPd" address/port (x.x.x.x:21) already in use by "ProFTPd"
server.name.com proftpd[1839] x.x.x.x: ProFTPD terminating (signal 11)
server.name.com proftpd[1839] x.x.x.x: FTP session closed.
/etc/init.d/proftpd: line 23: 1839 Segmentation fault $BINARY
 
You have pure-ftpd installed as well as proftpd. Something is missconfigured in your setup.

Check to see if you installed pure-ftpd from yum or apt-get and remove it.
 
We do not use or have pure-ftpd installed.

/usr/local/directadmin/custombuild# apt-get remove pure-ftpd
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package pure-ftpd is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

/etc/init.d# apt-get remove pure-ftpd*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting pure-ftpd-common for regex 'pure-ftpd*'
Note, selecting pure-ftpd-postgresql for regex 'pure-ftpd*'
Note, selecting pure-ftpd-mysql for regex 'pure-ftpd*'
Note, selecting pure-ftpd for regex 'pure-ftpd*'
Note, selecting pure-ftpd-ldap for regex 'pure-ftpd*'
E: Couldn't find package pure-ftpd*
 
Not sure why its talking about pure-ftpd then.

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

cd /usr/local/directadmin/custombuild
./build update
./build clean
./build proftpd d
 
/etc/init.d# cat /usr/local/directadmin/custombuild/options.conf | grep pure
pureftpd=no
 
Same problem.

Restarting ProFTPd.
Shutting down proftpd: cat: /var/run/proftpd.pid: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]

Starting proftpd: server.name.com proftpd[1839]: warning: "ProFTPd" address/port (x.x.x.x:21) already in use by "ProFTPd"
server.name.com proftpd[1839] x.x.x.x: ProFTPD terminating (signal 11)
server.name.com proftpd[1839] x.x.x.x: FTP session closed.
/etc/init.d/proftpd: line 23: 1839 Segmentation fault $BINARY

Here's the weird part. If i change port 21 in the proftpd.conf file to port 2121 proftpd starts and clients can connect to both port 21 and port 2121.

server:/etc/init.d# lsof -i :21
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
proftpd 21169 ftp 1u IPv6 41892511 TCP *:ftp (LISTEN)
server:/etc/init.d# lsof -i :2121
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
proftpd 21169 ftp 0u IPv6 41892510 TCP *:iprop (LISTEN)
server:/etc/init.d#

But when /etc/init.d/proftpd stop

LSOF shows nothing as if its not running for both port 21 or port 2121.
 
If this doesnt work you should have someone check your server.

Code:
perl -pi -e 's/proftpd=ON/proftpd=OFF/' /usr/local/directadmin/data/admin/services.status
perl -pi -e 's/pureftp=1/pureftp=0/' /usr/local/directadmin/conf/directadmin.conf
ps xua | grep -i proftpd | grep -v grep | awk '{print $2}' | xargs kill

wget -O /etc/init.d/proftpd "http://files.directadmin.com/services/custombuild/proftpd_debian"
chmod 755 /etc/init.d/proftpd

mv /etc/proftpd.conf /etc/proftpd.conf.bak

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

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

You should merge any changes back to your /etc/proftpd.conf when done or if it doesnt work just replace /etc/proftpd.conf with /etc/proftpd.conf.bak
 
me too. When I compiled the proftpd to 1.3.4a, one of the DA server fails to start

I have checked there are no other proftpd process running.

Please help.

DirectAdmin 1.40.1
CentOS 5.7 (2.6.18-274.12.1.el5)
ProFTPd 1.3.3.e to 1.3.4a

Below is last part of strace /usr/sbin/proftpd

Code:
[CODE]rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT BUS USR1 ALRM TERM CHLD IO], NULL, 8) = 0
geteuid()                               = 0
setresgid(-1, 0, -1)                    = 0
setresuid(-1, 0, -1)                    = 0
rt_sigprocmask(SIG_UNBLOCK, [HUP INT QUIT BUS USR1 ALRM TERM CHLD IO], NULL, 8) = 0
read(3, "", 1024)                       = 0
close(3)                                = 0
uname({sys="Linux", node="rose.???????.net", ...}) = 0
open("/etc/hosts", O_RDONLY)            = 3
fcntl(3, F_GETFD)                       = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=231, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2acda6f47000
read(3, "# Do not remove the following li"..., 4096) = 231
close(3)                                = 0
munmap(0x2acda6f47000, 4096)            = 0
open("/etc/hosts", O_RDONLY)            = 3
fcntl(3, F_GETFD)                       = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=231, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2acda6f47000
read(3, "# Do not remove the following li"..., 4096) = 231
close(3)                                = 0
munmap(0x2acda6f47000, 4096)            = 0
brk(0x89b3000)                          = 0x89b3000
rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT BUS USR1 ALRM TERM CHLD IO], NULL, 8) = 0
setresuid(-1, 0, -1)                    = 0
setresgid(-1, 0, -1)                    = 0
rt_sigprocmask(SIG_UNBLOCK, [HUP INT QUIT BUS USR1 ALRM TERM CHLD IO], NULL, 8) = 0
open("/var/run/proftpd.delay", O_RDWR|O_CREAT, 0666) = 3
rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT BUS USR1 ALRM TERM CHLD IO], NULL, 8) = 0
geteuid()                               = 0
setresgid(-1, 0, -1)                    = 0
setresuid(-1, 0, -1)                    = 0
rt_sigprocmask(SIG_UNBLOCK, [HUP INT QUIT BUS USR1 ALRM TERM CHLD IO], NULL, 8) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=100864, ...}) = 0
mmap(NULL, 100864, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = 0x2acda6f47000
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
write(2, "rose.???????????.net proftp"..., 88rose.???????????.net proftpd[29575] 1.2.3.4: ProFTPD terminating (signal 11)
) = 88
write(2, "rose.???????????.net proftp"..., 76rose.???????????.net proftpd[29575] 1.2.3.4: FTP session closed.
) = 76
rt_sigaction(SIGSEGV, {0x1, [SEGV], SA_RESTORER|SA_RESTART, 0x36760302d0}, {0x408bf0, [SEGV], SA_RESTORER|SA_RESTART, 0x36760302d0}, 8) = 0
rt_sigreturn(0xb)                       = 144250673
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
 
finally, as a workaround, I fall back to ProFTPd 1.3.3e at the moment, simply

vi /usr/local/directadmin/custombuild/versions.txt
Code:
proftpd:1.3.3e:f7a40961b7b677961659632386292fb0

./build proftpd d

It resumes as usual but running with ProFTPd 1.3.3e
 
Last edited:
Starting proftpd: server.name.com proftpd[20627]: warning: "ProFTPd" address/port (x.x.x.x:21) already in use by "ProFTPd"
server.name.com proftpd[20627] x.x.x.x: ProFTPD terminating (signal 11)
server.name.com proftpd[20627] x.x.x.x: FTP session closed.
/etc/init.d/proftpd: line 37: 20627 Segmentation fault $BINARY
I've seen that error recently on a client's box.

In his case, the cause was the server IP being present in the /etc/proftpd.vhosts.conf file, in a VirtualHost.
The server IP must not exist in the /etc/proftpd.vhosts.conf file.

As for how it got there was beyond my knowledge, but my guess would be that the server IP was not label "status=server" when an ftp account was created to it.
Perhaps it was a half-migrated server, I'm not too sure.

In any case:
1) Make sure the server IP does not exist in /etc/proftpd.vhosts.conf. Delete the VirtualHost if it exists.

2) Check your /etc/hosts file. Make sure your hostname resolves to your server IP, and not some other IP.

3) Check:
/usr/local/directadmin/data/admin/ips/1.2.3.4

for your server IP, and make sure it shows "status=server"

John
 
Hi John, I have the same problem. I have checked what you say:

1: My server ip does not exist in /etc/proftpd.vhosts.conf, the file is empty.

2: My hostname resolves to the server ip

3. I have checked /usr/local/directadmin/data/admin/ips/1.2.3.4, and the file contains "status=server" line.

My problem is:

New install of directadmin on a brand new server. I installed option 4 so that I could get custombuild 2.0. However it default installed pureftpd, so I changed to proftpd in options.conf and did ./build proftpd - it works.

However, every time I reboot the server, proftpd does not start, and the only way to make proftpd start again, is to do ./build proftpd, but then the next time I reboot the server, proftpd will not start again. Here is the errors in var/log/messages (I have masked my server ip with 1.2.3.4):

Code:
May 18 21:05:01 server proftpd[4558]: 1.2.3.4 - Failed binding to ::, port 21: Address already in use
May 18 21:05:01 server proftpd[4558]: 1.2.3.4 - Check the ServerType directive to ensure you are configured correctly.
May 18 21:05:01 server proftpd[4558]: 1.2.3.4 - Unable to start proftpd; check logs for more details
May 18 21:05:07 server proftpd[4577]: 1.2.3.4 - Failed binding to ::, port 21: Address already in use
May 18 21:05:07 server proftpd[4577]: 1.2.3.4 - Check the ServerType directive to ensure you are configured correctly.
May 18 21:05:07 server proftpd[4577]: 1.2.3.4 - Unable to start proftpd; check logs for more details
May 18 21:06:01 server proftpd[4635]: 1.2.3.4 - Failed binding to ::, port 21: Address already in use
May 18 21:06:01 server proftpd[4635]: 1.2.3.4 - Check the ServerType directive to ensure you are configured correctly.
May 18 21:06:01 server proftpd[4635]: 1.2.3.4 - Unable to start proftpd; check logs for more details
May 18 21:06:06 server proftpd[4655]: 1.2.3.4 - Failed binding to ::, port 21: Address already in use
May 18 21:06:06 server proftpd[4655]: 1.2.3.4 - Check the ServerType directive to ensure you are configured correctly.
May 18 21:06:06 server proftpd[4655]: 1.2.3.4 - Unable to start proftpd; check logs for more details

Is it because previous directadmin installed pureftpd as default? If so, must I remove/uninstall pureftpd? How can I do that then?

There was no option to not install pureftpd when first installing custombuild 2.0
 
Update: I have found that proftpd will not start after reboot because pureftpd is using port 21 after reboot. Please help.

How can I completely remove pureftpd so that it will not start after reboot? pureftpd was installed by directadmin custombuild 2.0, and I switched it to proftpd. But pureftpd is using port 21 after each reboot so that proftpd can't start.

I have temporarily fixed the problem and found this:

I run command: netstat -pant

In output I found this:

tcp 0 0 :::21 :::* LISTEN 3746/pure-ftpd (SER

Then I did: kill 3746

Then proftpd could start again.

But this will happen after each reboot. It was not a option when installing directadmin on new server with option 4 (custombuild 2.0), then it was not possible to not choose pureftpd, so therfor it was installed. Then I changed to proftpd in options.conf, then ./build proftpd - but pureftpd is still started after each reboot! I need to remove pureftpd so it does not bind on port 21 after reboot
 
OK. It is fixed now. Id did kill the pureftpd as described in previous post. Then I usend find / -name pure* and manually deleted the following:

Code:
/etc/logrotate.d/pure-ftpd
/etc/rc.d/init.d/pure-ftpd
/etc/pureftpd.pdb
/etc/pure-ftpd.pem
/usr/share/man/man8/pure-ftpd.8
/usr/local/directadmin/custombuild/pure-ftpd_debian
/usr/sbin/pure-ftpd
/var/lock/subsys/pure-ftpd
/var/run/pure-ftpd
/var/run/pure-ftpd.pid
/var/log/pureftpd.log

There was more files, but I was not sure all of them was related to pureftpd, so I did not delete the rest of the files, onlyl those above.

Then I did ./build proftpd , and then I rebooted the server to test if proftpd would start normally again - and it did.

@john, when I on a new directadmin install choose option 4 (custombuild 2.0), then please add a option to manually choose proftpd instead of pureftpd, because that was not an option, and I was forced to get pureftpd - and then you can read my problems when going from pureftpd to proftpd in custombuild created problems as described in previous posts.
 
It is now fixed in the latest release of CB 2.0, thank you for the report. When switching ftp services, pureftpd was not set to off in chkconfig earlier.
 
Back
Top