]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CONTRIB: tcploop: add action "X" to execute a command
authorWilly Tarreau <w@1wt.eu>
Tue, 2 May 2017 20:14:59 +0000 (22:14 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 3 May 2017 04:58:53 +0000 (06:58 +0200)
commitb7a6d0d8d781f8917709e9c111fe18877193147d
tree3c1ad2e3cc5f80308986c3de82cb2e4ff3dd1940
parent23953686da572fcbde697694cfbdb4b5df738a51
CONTRIB: tcploop: add action "X" to execute a command

Sometimes it's convenient to be able to execute a command directly on
the stream, whether we're connecting or accepting an incoming connection.
New command 'X' makes this possible. It simply calls execvp() on the
next arguments and branches stdin/stdout/stderr on the socket. Optionally
it's possible to limit the passed FDs to any combination of them by
appending 'i', 'o', 'e' after the X. In any case the program ends just
after executing this command.

Examples :
- chargen server
      tcploop 8001 L A Xo cat /dev/zero

- telnet server
      tcploop 8001 L W N A X /usr/sbin/in.telnetd
contrib/tcploop/tcploop.c