Please consider adding the socket-activated unit files from the user/systemd overlay to net-ftp/vsftpd. The two needed files are: vsftpd.socket: http://git.overlays.gentoo.org/gitweb/?p=user/systemd.git;a=blob;f=sys-apps/systemd-units/files/services-server/vsftpd.socket;h=cdc0d337efebde3db1dfbb90e472122fc5135dc5;hb=ce7abfc2ff3974449e6183f51357a80fe68a96d1 vsftpd@.serivce: http://git.overlays.gentoo.org/gitweb/?p=user/systemd.git;a=blob;f=sys-apps/systemd-units/files/services-server/vsftpd_at.service;h=5380b83ffcfe3ae9c005119bd17a241d039b1d70;hb=ce7abfc2ff3974449e6183f51357a80fe68a96d1
In Fedora and Arch I see they also provide a vsftpd@.serivice one (but not socket), also, reading that @ one, doesn't seem to have stuff that would vary, like: http://pkgs.fedoraproject.org/cgit/vsftpd.git/tree/vsftpd@.service
(In reply to Pacho Ramos from comment #1) > In Fedora and Arch I see they also provide a vsftpd@.serivice one (but not > socket), also, reading that @ one, doesn't seem to have stuff that would > vary, like: > http://pkgs.fedoraproject.org/cgit/vsftpd.git/tree/vsftpd@.service Hm, I don't really like the Fedora one, since it is forking, and there is no checking or overriding of the configuration. The @ can be used in two different ways. The Fedora unit file uses it to support multiple instances with different configuration files. For the socket-activation I used the @ so as not to conflict with the unit file vsftpd.service which is already included in gentoo. However, we could easily reverse which one contains the @ in its name, which is what the option Accept= is for in the .socket file.
(In reply to Henry Gebhardt from comment #2) > The @ can be used in two different ways. The Fedora unit file uses it to > support multiple instances with different configuration files. For the > socket-activation I used the @ so as not to conflict with the unit file > vsftpd.service which is already included in gentoo. However, we could easily > reverse which one contains the @ in its name, which is what the option > Accept= is for in the .socket file. I guess, the socket one could reuse already existing .service file? (without needing to add the "@" one)
(In reply to Pacho Ramos from comment #3) > (In reply to Henry Gebhardt from comment #2) > > The @ can be used in two different ways. The Fedora unit file uses it to > > support multiple instances with different configuration files. For the > > socket-activation I used the @ so as not to conflict with the unit file > > vsftpd.service which is already included in gentoo. However, we could easily > > reverse which one contains the @ in its name, which is what the option > > Accept= is for in the .socket file. > > I guess, the socket one could reuse already existing .service file? (without > needing to add the "@" one) Unfortunately, this does not work. I slightly misunderstood what the manpages were saying. If I am not mistaken, then vsftpd would need special support for systemd (see man sd_listen_fds) if not using the @ one for socket-activation. (Btw, sshd may be of interest here as it provides a precedence.)
(In reply to Pacho Ramos from comment #3) > (In reply to Henry Gebhardt from comment #2) > > The @ can be used in two different ways. The Fedora unit file uses it to > > support multiple instances with different configuration files. For the > > socket-activation I used the @ so as not to conflict with the unit file > > vsftpd.service which is already included in gentoo. However, we could easily > > reverse which one contains the @ in its name, which is what the option > > Accept= is for in the .socket file. > > I guess, the socket one could reuse already existing .service file? (without > needing to add the "@" one) With "Accept=yes" socket activation acts like an inetd and template service (with "@") is needed. From SYSTEMD.SOCKET(5): "For each socket file a matching service file (see systemd.service(5) for details) must exist, describing the service to start on incoming traffic on the socket. Depending on the setting of Accept= (see below), this must either be named like the socket unit, but with the suffix replaced; or it must be a template file named the same way. Example: a socket file foo.socket needs a matching service foo.service if Accept=false is set. If Accept=true is set a service template file foo@.service must exist from which services are instantiated for each incoming connection."
Ah, ok, thanks a lot (I am still learning a lot about all systemd stuff ;)). Will review this when I have a bit of time
+*vsftpd-3.0.2-r2 (03 Sep 2013) + + 03 Sep 2013; Pacho Ramos <pacho@gentoo.org> +files/vsftpd.socket, + +files/vsftpd_at.service, +vsftpd-3.0.2-r2.ebuild: + Add support for socket activation (#483270 by Henry Gebhardt and Alexander + Tsoy) +