summaryrefslogtreecommitdiff
path: root/tests/socket_test_script.sh
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-10-06 22:35:30 +0300
committerGitHub <[email protected]>2021-10-06 22:35:30 +0300
commit98f4e867af8e4dce3d8951227db8bd1268984551 (patch)
treeddf182386f78a64210e580bcf7a0c8ab34cf6712 /tests/socket_test_script.sh
parent59e29a90cfa6f16c790d16ac1f03a0f9f82b73d6 (diff)
parentb25e0bcc94b237b3fabf6f582a3864efd300033b (diff)
[#823]: feat(pipes,sockets): allow running scripts in the server's command
## Description of Changes - ✏️ Remove requirement to share the same PID for the worker and root process. According to the fork (and to be precise, `fork-exec` in go) man pages documentation, ```text The child inherits copies of the parent's set of open file descriptors. Each file descriptor in the child refers to the same open file description (see open(2)) as the corresponding file descriptor in the parent. This means that the two file descriptors share open file status flags, file offset, and signal-driven I/O attributes (see the description of F_SETOWN and F_SETSIG in fcntl(2)). ``` - ✏️ Server plugin can accept scripts (sh, bash, etc) in it's `command` configuration key: ```yaml server: command: "./script.sh OR sh script.sh" <--- UPDATED relay: "pipes" relay_timeout: "20s" ``` The script should start a worker as the last command. For the `pipes`, scripts should not contain programs, which can close `stdin`, `stdout` or `stderr`.
Diffstat (limited to 'tests/socket_test_script.sh')
-rwxr-xr-xtests/socket_test_script.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/socket_test_script.sh b/tests/socket_test_script.sh
new file mode 100755
index 00000000..3948c4fb
--- /dev/null
+++ b/tests/socket_test_script.sh
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+php ../../tests/client.php echo tcp