---
name: "execute-json-from-fifo"
section: "1"
platform: "linux"
package: "subuser"
version: "0.6.2-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/execute-json-from-fifo"
---

# execute-json-from-fifo(1)

Read a fifo stream of POSIX commands serialized as JSON and run them.

## NAME

execute-json-from-fifo - Read a fifo stream of POSIX commands serialized as JSON and run them.

## SYNOPSIS

**execute-json-from-fifo FIFO**

## DESCRIPTION

This is a very simple script which executes commands passed as JSON to a given named pipe. This is useful when one needs to create a super-privileged container which is able to run commands on the host system. It can also be used when one needs to give a container the ability to launch commands as a non-privileged user on the host.

To launch this script run:

```
$ execute-json-from-fifo PATH_TO_NAMED_PIPE
```

You can now send commands to the pipe. The protocol is as follows:

```
{"command":["echo", "some", "command"], "stdin":"path", "stdout":"path", "stderr":"path", "cwd":"path", "env":{"ENVVAR":"value"}}
```

Note: the protocol is newline delimited. So never include new-lines in the command objects.

stdin, stdout, stderr, cwd and env are all optional.

Passing \["exit"\] to command stops the script.

## AUTHOR

Timothy Hobbs (timothy.hobbs.cz)
