I have patched init script of net-ftp/vsftpd-1.2.2 to make it support virtual hosts. The problem with existent script, that if you create link vsftpd.eth1 -> vsftpd in init.d and new configuration file in conf.d with different config file, it would work... until you try to stop one of them. killall vsftpd will do it's work and kill both of daemons. Reproducible: Always Steps to Reproduce: 1.create 2 configs with different listen_address - /etc/vsftpd/vsftpd.conf and / etc/vsftpd.eth1.conf 2.ln -s /etc/init.d/vsftpd /etc/init.d/vsftpd.eth1 3.echo VSFTPD_CONF=/etc/vsftpd/vsftpd.eth1.conf >/etc/conf.d/vsftpd.eth1 4.start both and stop one of them 5.ps aux|grep vsftpd - oh no, we killed second daemon too :(
Created attachment 62001 [details] new vsftpd init script
Created attachment 62002 [details] default conf.d file
While I have no issue with the changes is there any reason why you cannot use tcpwrappers to enable virtual hosts via vsftp? Here's my line from /etc/hosts.allow vsftpd@192.168.2.3: ALL: setenv VSFTPD_LOAD_CONF /etc/vsftpd/vhost.conf This applies the options in vhost.conf to the main config - all settings can be turned on or off.
Yes, it is another way to do it, but you must have tcpwrappers in USE flags to do it in this manner. And the most important - "Gentoo is all about choice" ;) It's better when there are more than one way to done smth. I like more my variant and will be happy if my favourite distro support it.
OK - we cannot use this until we get baselayout-1.12.x stable due to bug #81819 And that won't happen for a while I'm afraid :/
Why not require BACKGROUND=NO in config, how i made it? It would i think resolve that bug... And what's about new baselayout? i haven't catched the connection.
No, the problem in bug #81819 is that any child processes spawned are not killed when we ask vsftpd to stop - hence using the killall statement as workaround. baselayout-1.12.x overrides the start-stop-daemon command so that all child processes are infact killed correctly.
Fixed in vsftpd-2.0.3-r2