passing additional FDs to service

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all!

I'm writing a small FastCGI daemon which, in addition to the socket used
to talk FastCGI to the web server, talks SMTP through another (inet)
socket (as an SMTP client).

The FastCGI socket is created by systemd with a .socket unit and passed
to the service as an fd (which also enables socket activation), while
the SMTP socket is opened and managed by the daemon itself.

What I'm asking here is if there's a way to also pass the SMTP socket as
a file descriptor to the daemon from systemd, so that the daemon doesn't
need to manage sockets itself (as all it does is reading fds passed by
the service manager) and can be further restricted with options like
PrivateNetwork=yes.

Ideally, I'd just get fd 3 and use it to listen for incoming requests,
and get fd 4 and use it to talk TLS + SMTP over TCP to the remote (or
local) SMTP server.

Is this currently possible with systemd? Am I missing something which
would make this a bad idea?

Thanks!




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux