[systemd-devel] inetd-style service with connection logging

Mantas Mikulėnas grawity at gmail.com
Fri Jun 17 05:00:20 UTC 2016


On Fri, Jun 17, 2016 at 5:05 AM, Brian Kroth <bpkroth at gmail.com> wrote:

> Hi, I'm trying to convert an old school inetd service into a systemd
> socket activation.
>
> More or less what was describe in [1] worked for me.  However, the bit I'm
> currently missing is connection logging.
>
> With the openbsd-inetd package (Debian), one could enable libwrap style
> logging with the -l option to inetd and get something like this:
>
> Jun 16 00:00:16 faitest32 inetd[16032]: connection from 10.130.105.148,
> service nrpe (tcp)
>
> Anyone know how to do that with systemd socket/service pairs?  Does it
> just require a ExecPreStart sort of rule to echo %i (or some such) into a
> logger pipe (or whatever the journal equivalent of that is), or is there a
> directive to get that that I'm just missing in my googling?
>

As of v209, the source address is *always* logged when the instance starts
(well, technically, it's added to the service description) – search the
journal for MESSAGE_ID=39f53479d3a045ac8e11786248231fbf. (Can't filter by
unit unfortunately since UNIT= only has the unique name of the instance,
not the generic one...)

Jun 16 18:19:10 frost systemd[1]: Started OpenSSH Per-Connection Daemon
([fd80:56c2:e21c:288b:8199:931f:3a4e:cfb3]:56168).
Jun 16 18:22:07 frost systemd[1]: Started OpenSSH Per-Connection Daemon (
10.114.14.18:60064).
Jun 17 07:52:34 frost systemd[1]: Started Ident (RFC 1413) per-connection
server ([::1]:50860).

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160617/acf74eae/attachment.html>


More information about the systemd-devel mailing list