{"id":13575349,"url":"https://github.com/flonatel/pipexec","last_synced_at":"2026-02-22T11:02:36.436Z","repository":{"id":15079642,"uuid":"17806057","full_name":"flonatel/pipexec","owner":"flonatel","description":"Handling pipe of commands like a single command","archived":false,"fork":false,"pushed_at":"2024-10-16T19:20:13.000Z","size":675,"stargazers_count":516,"open_issues_count":0,"forks_count":19,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-12-08T00:28:10.530Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flonatel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-03-16T18:34:35.000Z","updated_at":"2024-11-21T11:04:30.000Z","dependencies_parsed_at":"2024-06-21T18:56:25.791Z","dependency_job_id":"20b123fc-dac9-4d1a-abfe-5b3b0a094176","html_url":"https://github.com/flonatel/pipexec","commit_stats":{"total_commits":172,"total_committers":8,"mean_commits":21.5,"dds":0.4883720930232558,"last_synced_commit":"0cd2ac1197903cb8a497319624ba77aaf4ce35a3"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flonatel%2Fpipexec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flonatel%2Fpipexec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flonatel%2Fpipexec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flonatel%2Fpipexec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flonatel","download_url":"https://codeload.github.com/flonatel/pipexec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247260341,"owners_count":20909992,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T15:01:00.237Z","updated_at":"2025-10-21T13:08:56.814Z","avatar_url":"https://github.com/flonatel.png","language":"C","funding_links":[],"categories":["Process Manager","C"],"sub_categories":["Selfhosted"],"readme":"pipexec\n=======\n\nBuild a network of processes and connecting pipes - and have them act like a single process.\n\n[![Build Status](https://github.com/flonatel/pipexec/actions/workflows/compile-check.yml/badge.svg)](https://github.com/flonatel/pipexec/actions/workflows/compile-check.yml)\n[![Code Analysis](https://github.com/flonatel/pipexec/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/flonatel/pipexec/actions/workflows/codeql-analysis.yml)\n[![Release](https://img.shields.io/github/release/flonatel/pipexec.svg)](https://github.com/flonatel/pipexec/releases/latest)\n[![Packaging status](https://repology.org/badge/tiny-repos/pipexec.svg)](https://repology.org/project/pipexec/versions)\n[![License](https://img.shields.io/github/license/flonatel/pipexec.svg)](#license)\n[![Issues](https://img.shields.io/github/issues/flonatel/pipexec.svg)](https://github.com/flonatel/pipexec/issues)\n\n# Introduction and Purpose #\n*pipexec* has two major use cases.\n\n## Use Case 1: Handling Arbitrary Pipes between Processes ##\n\n### Basics ###\nWhen it comes to pipes in shells many tutorials introduce\n\u003ccode\u003estdin\u003c/code\u003e, \u003ccode\u003estdout\u003c/code\u003e and \u003ccode\u003estderr\u003c/code\u003e which\nmap to file descriptors 0, 1 and 2 respectively. \n\nIf you want to know how many lines contains the word *bird* in\nchapter 1 and 2 of your text, you can use a command like:\n\n    $ cat Chap1.txt Chap2.txt | grep bird | wc -l\n\nAnd pictures like this are shown to explain what happens internally:\n\n![Simple Pipe](doc/imgs/PipeSimpel1.png)\n\n### Advanced ###\nThe more advanced sections provide information how to use constructs\nlike \u003ccode\u003e2\u003e\u00261\u003c/code\u003e to redirect \u003ccode\u003estderr\u003c/code\u003e to\n\u003ccode\u003estdout\u003c/code\u003e.  And then you might come to the sections for the\npros and nerds. There is explained that you can build up a whole tree\nof processes like\n\n    $ find / 1\u003e \u003e(grep .txt) 2\u003e \u003e(wc \u003e/tmp/w.log)\n\n![Simple Tree](doc/imgs/PipeTree1.png)\n\n### The Hidden Universe of File-Descriptors, Processes and Pipes ###\nNobody will tell you:\n\n1. \u003ccode\u003estdin\u003c/code\u003e, \u003ccode\u003estdout\u003c/code\u003e and \u003ccode\u003estderr\u003c/code\u003e are\nartificial definitions.\n2. Also the relation to file descriptors 0, 1 and 2 is artificial.\n3. There are more than three file descriptors. On a typical Linux\nsystem each process has by default 1024 - which can be increased if\nneeded.\n4. From starting up processes and generating pipes between them there\nis mostly no limitation on system level; shells only support this in a\nvery limited way.\n\nThis is the moment when *pipexec* drops in: with *pipexec* you can\nstart up any kind of processes and build up pipes between them as you want.\n\n#### Cyclic ####\n\n    $ pipexec -- [ A /usr/bin/cmd1 ] [ B /usr/bin/cmd2 ] \"{A:1\u003eB:0}\" \"{B:1\u003eA:0}\"\n\ngives\n\n![Pipexec Cycle](doc/imgs/PipexecCycle.png)\n\n#### Complex ####\n*pipexec* supports any directed graph of processes and pipes like\n\n![Pipexec Complex](doc/imgs/PipexecComplex.png)\n\n## Use Case 2: Handle Bunch of Processes like one single Process ##\nMost systems to start and run processes during system start-up time do\nnot support pipe.  If you need to run a pipe of programs from an\n/etc/init.d script you are mostly lost.\n\nDepending on your distribution you can be happy if it starts up - but\nwhen it comes to stopping, at least the current Debian\nstart-stop-daemon and RHEL 6 daemon function fail.\n\nAlso here *pipexec* comes in: it starts up processes piped together,\nacts like a single process and supports pid file handling.\n\n# Usage\n    $ ./pipexec -h\n    pipexec version 2.5.5\n    (c) 2014-2015,2022 by Andreas Florath \u003candreas@florath.net\u003e\n    License GPLv2+: GNU GPL version 2 or later \u003chttp://gnu.org/licenses/gpl.html\u003e.\n\n    Usage: pipexec [options] -- process-pipe-graph\n    Options:\n     -h              display this help\n     -k              kill all child processes when one \n                     terminates abnormally\n     -l logfd        set fd which is used for logging\n     -p pidfile      specify a pidfile\n     -s sleep_time   time to wait before a restart\n    \n    process-pipe-graph is a list of process descriptions\n                       and pipe descriptions.\n    process description: '[ NAME /path/to/proc ]'\n    pipe description: '{NAME1:fd1\u003eNAME2:fd2}'\n\nExample:\n\n    $ pipexec -- [ LS /bin/ls -l ] [ GREP /bin/grep LIC ] '{LS:1\u003eGREP:0}'\n    -rw-r--r-- 1 florath florath 18025 Mar 16 19:36 LICENSE\n\nBe sure to escape pipe descriptions. Brackets for the command '[]' must be\nseparated by space! Definitions for pipes '{}' must not contain spaces!\n\nIt is possible to specify a fd for logging.\n\n    $ pipexec -l 2 -- [ LS /bin/ls -l ] [ GREP /bin/grep LIC ] '{LS:1\u003eGREP:0}'\n    2014-05-15 16:30:35;pipexec;23978;pipexec version 2.4\n    2014-05-15 16:30:35;pipexec;23978;Number of commands in command line [2]\n    2014-05-15 16:30:35;pipexec;23978;Number of pipes in command line [1]\n    2014-05-15 16:30:35;pipexec;23978;[LS] command_info path [/bin/ls]\n    2014-05-15 16:30:35;pipexec;23978;[GREP] command_info path [/bin/grep]\n    2014-05-15 16:30:35;pipexec;23978;{0} Pipe [LS] [1] \u003e [GREP] [0]\n    2014-05-15 16:30:35;pipexec;23978;Cannot set restart flag - process will terminate\n    2014-05-15 16:30:35;pipexec;23978;Start all [2] children\n    [...]\n\nOr\n\n    $ pipexec -l 7 -- [ LS /bin/ls -l ] [ GREP /bin/grep LIC ] '{LS:1\u003eGREP:0}' 7\u003e/tmp/pipexec.log\n    -rw-r--r-- 1 florath florath 18025 Mar 16 19:53 LICENSE\n    $ head -2 /tmp/pipexec.log\n    2014-05-15 16:30:35;pipexec;23978;pipexec version 2.4\n    2014-05-15 16:30:35;pipexec;23978;Number of commands in command line [2]\n\n# Installation #\n\n## From Packages ##\nThe following Linux distributions include the package.  You can\ninstall pipexec with the distribution's package manager:\n* [Debian](https://packages.debian.org/search?keywords=pipexec)\n* [Ubuntu](https://packages.ubuntu.com/search?keywords=pipexec)\n* [Alpine Linux](https://pkgs.alpinelinux.org/packages?name=pipexec)\n* [Archlinux](https://aur.archlinux.org/packages/pipexec)\n* [Raspbian](https://www.raspbian.org/)\n* [Kali](https://pkg.kali.org/pkg/pipexec)\n* [AOS](http://aos.ion.nu/buildwiki/pipexec.html)\n* [Linux Mint](https://community.linuxmint.com/software/view/pipexec)\n\n## From Source ##\n[Download the latest tar ball](https://github.com/flonatel/pipexec/releases)\n\n    $ tar -xf pipexec-X.Y.Z.tar.xz\n    $ mkdir PIPEXECBUILD\n    $ cd PIPEXECBUILD\n    $ ${PWD}/../pipexec-X.Y.Z/configure\n    $ make\n\nThere will be three binaries in the bin directory: pipexec, ptee and\npeet.  You can copy / install them as you need.\n\n# Copyright #\n\ncopyright 2015, 2022, 2024 by Andreas Florath\n\nLicense: see LICENSE file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflonatel%2Fpipexec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflonatel%2Fpipexec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflonatel%2Fpipexec/lists"}