{"id":26496760,"url":"https://github.com/maxim2266/run","last_synced_at":"2026-01-17T07:19:56.963Z","repository":{"id":277536450,"uuid":"932727032","full_name":"maxim2266/run","owner":"maxim2266","description":"A minimal `pid 1` process for Docker containers.","archived":false,"fork":false,"pushed_at":"2026-01-16T11:25:39.000Z","size":67,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-17T01:13:39.574Z","etag":null,"topics":["containerization","docker","init","pid1","service-management"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxim2266.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-14T12:08:32.000Z","updated_at":"2026-01-15T13:09:35.000Z","dependencies_parsed_at":"2025-02-14T13:32:22.223Z","dependency_job_id":"eb80e006-f70d-48d0-8cc3-d1160a9f9e97","html_url":"https://github.com/maxim2266/run","commit_stats":null,"previous_names":["maxim2266/run"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/maxim2266/run","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim2266%2Frun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim2266%2Frun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim2266%2Frun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim2266%2Frun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxim2266","download_url":"https://codeload.github.com/maxim2266/run/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim2266%2Frun/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28503511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["containerization","docker","init","pid1","service-management"],"created_at":"2025-03-20T12:42:44.916Z","updated_at":"2026-01-17T07:19:56.955Z","avatar_url":"https://github.com/maxim2266.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## `run`: A minimal `pid 1` process for Docker containers.\n\n[![License: BSD 3 Clause](https://img.shields.io/badge/License-BSD_3--Clause-yellow.svg)](https://opensource.org/licenses/BSD-3-Clause)\n\n`run` spawns a single child process, then waits for it and _all descendants_ to complete, while\nreaping zombie processes and forwarding Unix signals to the entire process group.\n\n### Motivation\nYears ago, when the concept of the \"cloud\" was just emerging, I imagined it as a collection of\nnetworked Linux computers, each fully set up, and with a service manager I could configure to\nrun my software. It turned out I was wrong: Docker containers run only one process, and cloud\nproviders essentially charge us per each process we start. Not a good state of affairs, but\nI cannot change the world. All I want is to run inside my container something as simple as:\n```shell\n/bin/run sh -c 'service1 \u0026 service2 \u0026 service3 \u0026'\n```\nand reduce my cloud bill by two-thirds.\n\n### Invocation\n```\n▶ ./run -h\nUsage:\n  run [-qset] cmd [args...]\n  run [-hv]\n\nStart `cmd`, then wait for it and all its descendants to complete.\n\nOptions:\n  -q       Reduce logging level (may be given more than once).\n  -s SIG   Send signal SIG to all remaining processes when one terminates with an error;\n           SIG can be any of: INT, TERM, KILL, QUIT, HUP, USR1, USR2.\n  -e CODE  Minimal process exit code to be treated as an error (default: 0).\n  -t N     Wait N seconds before sending KILL signal to all remaining processes.\n  -h       Show this help and exit.\n  -v       Show version and exit.\n```\nWith no options `run` simply starts the given command and waits for it and all descendants\nto complete, otherwise:\n* With `-s` option it sends the given signal to the entire process group when any process\n  terminates. _Note_: Linux shells typically block INT and QUIT signals.\n* With `-e` option the above signal is sent only when a process exits with a code greater\n  or equal to the one specified.\n* With `-t` option KILL signal is sent to all the remaining processes after the specified timeout.\n\nOptions `-e` and `-t` are meaningless without `-s`. In practice `-s` and `-t` are usually set\nto reflect Docker defaults: `-s SIGTERM -t 10`.\n\nExit code from `run` is that of the first process terminated with non-zero code, or 0 if all\ncompleted successfully.\n\n### Setup\n```shell\ngit clone https://github.com/maxim2266/run.git\ncd run\nmake image\n```\nThe last command builds an image according to the provided [dockerfile](runner.dockerfile).\nOther targets:\n* `make test` to run all tests in a container;\n* `make` to build the program locally.\n\n### Further Development\nAt the moment the program does the intended job reasonably well, but there are other features\nthat would be nice to have in the future:\n* Ability to launch multiple services without a shell.\n* Collect STDOUT and STDERR from each service individually, to make sure they don't share\n  the same Unix pipe.\n* Service management, able (at least) to restart a process without shutting down the whole\n  container.\n* `setuid`, although this is likely to (massively) complicate the code.\n\nI don't know if anything of the above will ever be implemented.\n\n### License\nBSD-3-Clause\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxim2266%2Frun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxim2266%2Frun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxim2266%2Frun/lists"}