{"id":35155983,"url":"https://github.com/daniel7grant/subvisor","last_synced_at":"2026-05-01T05:32:24.772Z","repository":{"id":56059292,"uuid":"280366923","full_name":"daniel7grant/subvisor","owner":"daniel7grant","description":"A subset of the supervisord library, entirely rewritten in C, optimized for containers.","archived":false,"fork":false,"pushed_at":"2020-12-28T01:41:59.000Z","size":201,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-25T12:07:14.716Z","etag":null,"topics":["c","docker","supervisord"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daniel7grant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-17T08:12:57.000Z","updated_at":"2021-01-16T21:06:12.000Z","dependencies_parsed_at":"2022-08-15T12:20:47.748Z","dependency_job_id":null,"html_url":"https://github.com/daniel7grant/subvisor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/daniel7grant/subvisor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel7grant%2Fsubvisor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel7grant%2Fsubvisor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel7grant%2Fsubvisor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel7grant%2Fsubvisor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daniel7grant","download_url":"https://codeload.github.com/daniel7grant/subvisor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel7grant%2Fsubvisor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28101587,"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-12-28T02:00:05.685Z","response_time":62,"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":["c","docker","supervisord"],"created_at":"2025-12-28T17:00:01.240Z","updated_at":"2025-12-28T17:00:05.997Z","avatar_url":"https://github.com/daniel7grant.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# subvisord\n\nA subset of the supervisord library, entirely rewritten in C, optimized for containers.\n\n## Motivation\n\n## Get started\n\nYou only need the subvisord binary ([Installation](#installation)) and define the programs that need to be started in `subvisord.conf`, and you can get going it with the `-c` flag:\n\n```sh\nsubvisord -c /path/to/file/subvisord.conf\n```\n\nBy default, the subvisord daemonizes itself, if you want to run it in the foreground (useful for containers, systemd units, and testing) you can add the `-n` flag (or add `nodaemon=true` to the global configuration). For the complete command-line API, check `--help`.\n\n### Simple startup\n\nThe subvisord configuration is a Windows-style INI file, in which you have to define sections (in square brackets, e.g. `[subvisord]`), and for each section some or none key-value pairs (like `nodaemon=true`) line-by-line. It is important to note that subvisord tries to be as compatible with the supervisord configuration files as it can however it also accepts all `supervisor` containing options as `subvisor`, because why type so much...\n\nThe simplest way is just creating a new file with the section `[subvisord]` (this is where the global configuration resides) and then list out the programs in separate sections, with the name `[program:\u003cuniquename\u003e]`. The only requirement for program sections is to define the `command` which should be executed (remember that this process should be started in the foreground).\n\nYou can start a basic web server and php process manager with the following configuration:\n\n```ini\n[subvisord]\n\n[program:nginx]\ncommand=/usr/sbin/nginx -g 'daemon off;'\n\n[program:php-fpm]\ncommand=/usr/sbin/php-fpm7 -F\n```\n\n### Advanced configuration\n\nFor subprocesses subvisord has sane defaults: they are autostarted on startup and restarted in case of an unexpected (non-zero) exit. However, if you want to define one-shot processes (processes that run and then exit expectedly), or change the failure exit codes or restart times and retries, you can do that too.\n\n```ini\n[subvisord]\n\n[program:nginx]\ncommand=/usr/sbin/nginx -g 'daemon off;'\n# We set to always autorestart (even if it exists with 0)\n# and retry it 10 times before considering it the state FATAL\nautorestart=true\nstartretries=10\n\n# Don't restart this process (one-shot)\n[program:clear-cache]\ncommand=/bin/rm -rf /var/cache/nginx\nautorestart=false\n```\n\n### Privileges configuration\n\nSubvisord is often started as root, however, the principle of least privilege suggests to prefer processes started as non-root users. You can still keep running subvisord as root and set the `user` key in the subvisord configurations to switch to another user on startup. You can either define globally in the `[subvisord]` section (then all processes will be started as that user) or set it for program sections one by one. \n\nYou can use the global `user` setting:\n\n```ini\n[subvisord]\nuser=www\n\n# These processes will start with the `www` user\n[program:nginx]\ncommand=/usr/sbin/nginx -g 'daemon off;'\n\n[program:php-fpm]\ncommand=/usr/sbin/php-fpm7 -F\n```\n\nor for each program one-by-one:\n\n```ini\n[subvisord]\n\n[program:nginx]\ncommand=/usr/sbin/nginx -g 'daemon off;'\nuser=nginx\n\n[program:php-fpm]\ncommand=/usr/sbin/php-fpm7 -F\nuser=php\n```\n\n### Logging configuration\n\nOne of the primary advantages of using subvisord is that it can manage and rotate the standard output and error for its subprocesses. By default, it automatically creates log files for each subprocess in the temp directory (it can be modified in the global configuration with the `childlogdir` setting). It is however often preferred to manage the log files separately for each program: `stdout_logfile` and `stderr_logfile` can handle the output and error streams (or redirect error logs to stderr with `redirect_srderr`). Logfiles are also automatically rotated (moved to separate files) every 50MBs until it reaches 10 files, after then, the oldest files are deleted (rotation can be configured with `stdout/stderr_maxbytes` and `stdout/stderr_backups` respectively). These settings allow versatile handling of output logging, without requiring external libraries.\n\nSet logfiles for all subprocesses via `childlogdir`:\n\n```ini\n[subvisord]\nchildlogdir=/var/log/subvisor\nlogfile = /tmp/supervisord.log\nlogfile_maxbytes = 50MB\nlogfile_backups=10\nloglevel = info\n\n# Output will be saved in /var/log/subvisor/nginx--stdout--{hash}.log\n[program:nginx]\ncommand=/usr/sbin/nginx -g 'daemon off;'\n```\n\nSet log files and rotations for the subvisord process and all subprocesses separately:\n\n```ini\n# Log parent debugging messages without rotation to /var/log\n[subvisord]\nlogfile = /var/log/supervisord.log\nlogfile_maxbytes = 0\nloglevel = debug\n\n# Write logs to access and error files, with default rotation\n[program:nginx]\ncommand=/usr/sbin/nginx -g 'daemon off;'\nstdout_logfile=/var/log/supervisor/nginx.access.log\nstderr_logfile=/var/log/supervisor/nginx.error.log\n\n# Collect stdout and stderr to one log file with 5MB rotations\n[program:php-fpm]\ncommand=/usr/sbin/php-fpm7 -F\nredirect_stderr=true\nstdout_logfile=/var/log/supervisor/php-fpm.log\nstdout_logfile_maxbytes=5MB\nstdout_logfile_backups=10\n```\n\n## Installation\n\n### Build from source\n\nYou can build subvisord from source, by cloning this repository and simply running `make` (it has no other dependencies apart from `make`, `gcc` and standard headers). By default, it works from the `src/` directory and outputs the binaries to the `build/` directory. You can start the subvisord program by running `subvisord` from the `build/` directory:\n\n```sh\nmake\nbuild/subvisord --help\n```\n\nIt should work on any POSIX-compliant OS with any libc (primarily tested on Manjaro + glibc, and Alpine + musl).\n\n### Static build\n\nYou can build to a statically linked binary with the `-static` flag (this builds all dependencies into the binary):\n\n```sh\nmake LDFLAGS=-static\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel7grant%2Fsubvisor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaniel7grant%2Fsubvisor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel7grant%2Fsubvisor/lists"}