PDA

View Full Version : ProFTPD Update 1.3.4a Segmentation fault



splitech
11-15-2011, 08:35 AM
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

SeLLeRoNe
11-15-2011, 08:45 AM
try remove /etc/init.d/proftpd (or rename with .1) and rebuild proftpd server.

Regards

splitech
11-15-2011, 08:55 AM
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

scsi
11-15-2011, 09:02 AM
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.

splitech
11-15-2011, 09:06 AM
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*

scsi
11-15-2011, 10:44 AM
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

SeLLeRoNe
11-15-2011, 10:58 AM
post result for:


cat /usr/local/directadmin/custombuild/options.conf | grep pure



Regards

splitech
11-15-2011, 10:59 AM
/etc/init.d# cat /usr/local/directadmin/custombuild/options.conf | grep pure
pureftpd=no

SeLLeRoNe
11-15-2011, 11:01 AM
Try the scsi way on post #6 and let us know.

Regards

splitech
11-15-2011, 11:03 AM
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.

SeLLeRoNe
11-15-2011, 11:35 AM
Try kill manually:



killall -9 proftpd
/usr/local/directadmin/custombuild/build proftpd

scsi
11-15-2011, 01:17 PM
If this doesnt work you should have someone check your server.



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

ccto
12-14-2011, 11:20 AM
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]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 +++

ccto
12-14-2011, 11:28 AM
finally, as a workaround, I fall back to ProFTPd 1.3.3e at the moment, simply

vi /usr/local/directadmin/custombuild/versions.txt

proftpd:1.3.3e:f7a40961b7b677961659632386292fb0

./build proftpd d

It resumes as usual but running with ProFTPd 1.3.3e

DirectAdmin Support
12-14-2011, 10:03 PM
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 $BINARYI'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

DirectAdmin Support
12-14-2011, 10:05 PM
The other alternative is to convert the works over to the unified_ftp_password_file format, where all passwords are in /etc/proftpd.passwd, and the proftpd.vhosts.conf is not needed (will be empty).

See:
http://www.directadmin.com/features.php?id=1134

All new DA installs will have this option enabled.

John