pure-ftpd fails to start in a OpenVZ server

Issue : pure-ftpd was not starting in a ispCP enabled VPS server. It was showing failed status in both xinetd and standalone version. ispCP stores the information in MySQL database.

Troubleshooting :

Run the pure-ftpd script using the command itself, and without the sysV startup script.
/usr/sbin/pure-ftpd --daemonize -A -c50 -B -C8 -D -E -fftp -H -I15 -lmysql:/etc/pure-ftpd/pureftpd-mysql.conf -L7500:8 -m4 -s -U133:022 -u500 -i -Oclf:/var/log/pureftpd.log -k99 -Z -4

Again failure. Now turn for strace.
yum install strace

Error to be noted was below

capset(0x19980330, 0, {CAP_CHOWN|CAP_DAC_READ_SEARCH|CAP_SETGID|CAP_SETUID|CAP_NET_BIND_SERVICE|CAP_NET_ADMIN|CAP_SYS_CHROOT|CAP_SYS_NICE, CAP_CHOWN|CAP_DAC_READ_SEARCH|CAP_SETGID|CAP_SETUID|CAP_NET_BIND_SERVICE|CAP_NET_ADMIN|CAP_SYS_CHROOT|CAP_SYS_NICE, 0}) = -1 EPERM (Operation not permitted)

followed by a log message in /var/log/messages as
pure-ftpd: (?@?) [ERROR] Unable to switch capabilities : Operation not permitted

Edit the VPS configuration file in the node to add lines below directly as below and then restart the vps from node or PIM or anything you use as the control panel.

CAPABILITY=”CHOWN:on DAC_READ_SEARCH:on SETGID:on SETUID:on NET_BIND_SERVICE:on NET_ADMIN:on SYS_CHROOT:on SYS_NICE:on”

A restart of VPS should fix the error

Continue Reading

About this blog

This blog, acts as a knowledge repository for the world and is unofficial! Anything we find interesting in the cyber world will go here. Most cases, this blog will reflect the happiness of our staff in reaching successful solution to an issue (s)he worked on. A reference for other fellow SAGEs who come across similar issues later