{"id":24056893,"url":"https://github.com/fboulnois/luavisors","last_synced_at":"2026-02-09T12:33:50.278Z","repository":{"id":270525714,"uuid":"910655542","full_name":"fboulnois/luavisors","owner":"fboulnois","description":"A small and scriptable process supervisor for containers using Rust and Lua.","archived":false,"fork":false,"pushed_at":"2025-01-02T19:16:01.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-04T09:16:28.053Z","etag":null,"topics":["docker","init","init-system","linux","lua","luajit","pid1","rust","scripting","supervisor"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fboulnois.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}},"created_at":"2025-01-01T00:21:30.000Z","updated_at":"2025-06-18T03:18:52.000Z","dependencies_parsed_at":"2025-01-01T00:36:53.058Z","dependency_job_id":"e4359f59-4ad5-4732-88f3-523abd92ea0c","html_url":"https://github.com/fboulnois/luavisors","commit_stats":null,"previous_names":["fboulnois/luavisors"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/fboulnois/luavisors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fboulnois%2Fluavisors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fboulnois%2Fluavisors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fboulnois%2Fluavisors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fboulnois%2Fluavisors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fboulnois","download_url":"https://codeload.github.com/fboulnois/luavisors/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fboulnois%2Fluavisors/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270311467,"owners_count":24563283,"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","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["docker","init","init-system","linux","lua","luajit","pid1","rust","scripting","supervisor"],"created_at":"2025-01-09T05:27:28.053Z","updated_at":"2026-02-09T12:33:48.194Z","avatar_url":"https://github.com/fboulnois.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# luavisors\n\nA small and scriptable process supervisor for containers using Rust and Lua.\n\n## Why\n\n`luavisors` provides flexible process management through Lua scripting. This\nallows you to run and supervise one or more processes within a single container\nusing custom supervision logic, unlike simple process supervisors such as\n[`dumb-init`](https://github.com/Yelp/dumb-init) or [`tini`](https://github.com/krallin/tini).\n\n`luavisors` is a lightweight process supervisor with built-in start, stop, and\nscheduling capabilities in a single static binary. Unlike more complex tools\nsuch as `systemd`, `openrc`, `runit`, or `s6`, it doesn't require additional\nsoftware to be installed or complicated configuration files.\n\n## Features\n\n- **Lightweight**: `luavisors` is a single static binary with no external\n  dependencies.\n- **Scriptable**: Supervision logic is written in Lua and enhanced with a bit of\n  Rust.\n- **Flexible**: Supervise multiple processes with custom start and stop logic.\n  Schedule processes to run at specific intervals.\n- **Snappy**: Written in Rust with a small asynchronous core to be fast and\n  efficient.\n- **Portable**: Designed to run in the most [minimal containers](https://github.com/GoogleContainerTools/distroless)\n  and environments. No additional software or configuration files are required.\n- **Minimal**: Focused solely on process supervision and scheduling with a\n  simple API.\n\n## Usage\n\n`luavisors` is intended to run as the main or `init` process (`pid1`) in a\ncontainer, but can also be run as a standalone process supervisor. Like other\nprocess supervisors, it will forward signals to child processes and reap zombie\nprocesses.\n\nTo run a Lua script with `luavisors`, pass either the script path or the script\nitself as a string followed by any additional arguments:\n\n```sh\nluavisors [script [args...]]\n```\n\n`luavisors` embeds LuaJIT and enables the [Lua 5.2 extensions](https://luajit.org/extensions.html#lua52)\nand [FFI library](https://luajit.org/ext_ffi.html), so newer language features\nare available and C functions and libraries can be called directly from Lua.\n\n## API\n\n`luavisors` exposes a Lua module called `init`. This module provides the main\nfunctions to start, stop, and schedule processes:\n\n```lua\n-- Require the init module\nlocal init = require('init')\n\n-- Get the process id of the parent process\ninit.pid()\n\n-- Send a signal to a process\ninit.kill(pid, signal)\n\n-- Sleep for a number of seconds\ninit.sleep(seconds)\n\n-- Run a function every number of seconds asynchronously\ninit.every(seconds, function, ...)\n\n-- Execute a child process asynchronously\nlocal child = init.exec(command, ...)\n\n-- Get the child process id\nchild:pid()\n\n-- Get the child process output\nchild:stdout()\n\n-- Get the child process errors\nchild:stderr()\n\n-- Get the child process status\nchild:status()\n\n-- Kill the child process directly\nchild:kill()\n\n-- Standard signals are available in the `signal` table\ninit.signal.SIGTERM\ninit.signal.SIGKILL\n-- etc.\n```\n\n## Examples\n\nSee the `lua/` directory for more detailed examples:\n\n- [`api.lua`](lua/api.lua): A complete demonstration of the `init` API\n- [`simple.lua`](lua/simple.lua): Launches two child processes asynchronously\n  and waits for them to finish\n- [`advanced.lua`](lua/advanced.lua): Launches a main process and a scheduled\n  update process which stops the main process and restarts it after the update\n  completes\n\nTo run an example:\n\n```sh\nluavisors lua/api.lua\n# or from the root directory\ncargo run -- lua/api.lua\n```\n\nSee also the included [`Dockerfile`](./Dockerfile) for a Docker-based example.\n\n## Development\n\n### Building\n\nTo build the executable:\n\n```sh\ncargo build --release\n```\n\n### Testing\n\nTo run the tests:\n\n```sh\ncargo test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffboulnois%2Fluavisors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffboulnois%2Fluavisors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffboulnois%2Fluavisors/lists"}