[systemd-devel] xinetd REMOTE_IP (feature request)

Tomasz Torcz tomek at pipebreaker.pl
Thu Nov 13 10:58:24 PST 2014


On Thu, Nov 13, 2014 at 01:53:12PM -0500, Fisher, Charles J. (Top Echelon) wrote:
> The xinetd server from previous versions of RedHat defined a REMOTE_IP environment variable.
> 
> I realize that I can extract that data with the following code:
> 
> {
> struct sockaddr_in thisconn;
> int thislen = sizeof(thisconn);
> getpeername( /* STDIN */ 0, &thisconn, &thislen);
> printf("%s\n", inet_ntoa(thisconn.sin_addr));
> }
> 
> ...but it would be nice if the behavior matched xinetd.

  You can do it in shell by parsing instance name embedded
in /proc/self/cgroup

-- 
Tomasz Torcz               RIP is irrevelant. Spoofing is futile.
xmpp: zdzichubg at chrome.pl     Your routes will be aggreggated. -- Alex Yuriev



More information about the systemd-devel mailing list