Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 483270 - net-ftp/vsftpd - add systemd unit with socket-based activation
Summary: net-ftp/vsftpd - add systemd unit with socket-based activation
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Markos Chandras (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: install-systemd-unit
  Show dependency tree
 
Reported: 2013-09-01 15:02 UTC by Henry Gebhardt
Modified: 2013-09-03 20:11 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Pacho Ramos gentoo-dev 2013-09-01 15:11:42 UTC
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
Comment 2 Henry Gebhardt 2013-09-01 15:23:49 UTC
(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.
Comment 3 Pacho Ramos gentoo-dev 2013-09-01 18:28:13 UTC
(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)
Comment 4 Henry Gebhardt 2013-09-02 00:35:19 UTC
(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.)
Comment 5 Alexander Tsoy 2013-09-02 12:34:30 UTC
(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."
Comment 6 Pacho Ramos gentoo-dev 2013-09-02 17:25:19 UTC
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
Comment 7 Pacho Ramos gentoo-dev 2013-09-03 20:11:35 UTC
+*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)
+