Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 537286

Summary: net-ftp/vsftpd - add support for multiple virtual servers to logrotate script
Product: Gentoo Linux Reporter: tom reinertson <rhumbliner>
Component: [OLD] ServerAssignee: Markos Chandras (RETIRED) <hwoarang>
Status: RESOLVED FIXED    
Severity: normal CC: bugs, net-ftp, proxy-maint, wired
Priority: Normal Keywords: PATCH
Version: autobuilds   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch to vsftpd.logrotate

Description tom reinertson 2015-01-21 20:46:17 UTC
Created attachment 394526 [details]
patch to vsftpd.logrotate

it is possible to run multiple virtual ftp servers using vsftpd.  this is accomplished by creating multiple configuration files each with a unique listen_port or listen_address and placing them into /etc/vsftpd/ with unique service names of the form "vsftpd.server-1.conf", "vsftpd.server-2.conf", etc.

the current vsftpd.init script correctly handles this situation and assumes the system administrator creates symlinks in /etc/init.d/ that link back to vsftpd, such as vsftpd.server-1 -> vsftpd and vsftpd.server-2 -> vsftpd much like net.eth0 is symlinked to net.lo.

however, vsftpd.logrotate cannot handle the multiple log files that may be created by multiple configuration files.  following the template used by the init script, the log files would reasonably be named vsftpd.server-1.log and vsftpd.server-2.log.

the current vsftpd.logrotate file contains:
/var/log/vsftpd.log {
    missingok
    notifempty
}

i believe it should contain:
/var/log/vsftpd*.log {
    missingok
    notifempty
}

in addition, since /etc/logrotate.conf already contains the "notifempty" command, i believe it can be removed from vsftpd.logrotate:
/var/log/vsftpd*.log {
    missingok
}
Comment 1 Markos Chandras (RETIRED) gentoo-dev 2015-03-01 15:56:10 UTC
I'd rather keep notifempty since the main logrotate conf file may change in the future. I applied the rest of your patch without revbump. thanks

+  01 Mar 2015; Markos Chandras <hwoarang@gentoo.org> files/vsftpd.logrotate:
+  Amend logrotate file to handle multiple servers. Bug #537286 by tom reinertson
+