<p dir="ltr"><br>
On Jun 17, 2016 11:11, "Brian Kroth" <<a href="mailto:bpkroth@gmail.com">bpkroth@gmail.com</a>> wrote:<br>
><br>
> Mantas Mikulėnas <<a href="mailto:grawity@gmail.com">grawity@gmail.com</a>> 2016-06-17 08:00:<br>
>><br>
>> On Fri, Jun 17, 2016 at 5:05 AM, Brian Kroth <<a href="mailto:bpkroth@gmail.com">bpkroth@gmail.com</a>> wrote:<br>
>><br>
>>> Hi, I'm trying to convert an old school inetd service into a systemd<br>
>>> socket activation.<br>
>>><br>
>>> More or less what was describe in [1] worked for me. However, the bit I'm<br>
>>> currently missing is connection logging.<br>
>>><br>
>>> With the openbsd-inetd package (Debian), one could enable libwrap style<br>
>>> logging with the -l option to inetd and get something like this:<br>
>>><br>
>>> Jun 16 00:00:16 faitest32 inetd[16032]: connection from 10.130.105.148,<br>
>>> service nrpe (tcp)<br>
>>><br>
>>> Anyone know how to do that with systemd socket/service pairs? Does it<br>
>>> just require a ExecPreStart sort of rule to echo %i (or some such) into a<br>
>>> logger pipe (or whatever the journal equivalent of that is), or is there a<br>
>>> directive to get that that I'm just missing in my googling?<br>
>>><br>
>><br>
>> As of v209, the source address is *always* logged when the instance starts<br>
>><br>
>> (well, technically, it's added to the service description) – search the<br>
>> journal for MESSAGE_ID=39f53479d3a045ac8e11786248231fbf. (Can't filter by<br>
>> unit unfortunately since UNIT= only has the unique name of the instance,<br>
>> not the generic one...)<br>
>><br>
>> Jun 16 18:19:10 frost systemd[1]: Started OpenSSH Per-Connection Daemon<br>
>> ([fd80:56c2:e21c:288b:8199:931f:3a4e:cfb3]:56168).<br>
>> Jun 16 18:22:07 frost systemd[1]: Started OpenSSH Per-Connection Daemon (<br>
>> <a href="http://10.114.14.18:60064">10.114.14.18:60064</a>).<br>
>> Jun 17 07:52:34 frost systemd[1]: Started Ident (RFC 1413) per-connection<br>
>> server ([::1]:50860).<br>
><br>
><br>
> Hmm, I'm running v215 on a Debian Jessie machine, but that MESSAGE_ID isn't turning anything up for the messages I was expecting.<br>
><br>
> # journalctl --all -x | grep -i nrpe<br>
> ...<br>
> Jun 17 10:05:15 faitest64 systemd[1]: [/etc/systemd/system/nagios-nrpe-server@.service:25] Failed to parse nice priority, ignoring: $NICENESS.<br>
><br>
> (from before I took that out from my other question thread)<br>
><br>
><br>
> # journalctl MESSAGE_ID=39f53479d3a045ac8e11786248231fbf<br>
> -- Logs begin at Thu 2016-06-16 18:46:02 CDT, end at Fri 2016-06-17 11:09:04 CDT. --<br>
> Jun 17 00:19:35 faitest64 systemd[886]: Reached target Paths.<br>
> Jun 17 00:19:35 faitest64 systemd[886]: Reached target Timers.<br>
> Jun 17 00:19:35 faitest64 systemd[886]: Reached target Sockets.<br>
> Jun 17 00:19:35 faitest64 systemd[886]: Reached target Basic System.<br>
> Jun 17 00:19:35 faitest64 systemd[886]: Reached target Default.<br>
> Jun 17 00:19:40 faitest64 systemd[886]: Reached target Shutdown.<br>
><br>
><br>
> Do you know the commit id for that change offhand? Maybe Debian stripped the patch or something, though I'm not sure why that would have happened.<br>
><br>
> Thanks,<br>
> Brian</p>
<p dir="ltr">Anyone else have any other thoughts on the lack of inetd style connection logs?</p>
<p dir="ltr">Thanks,<br>
Brian</p>