{"id":21033333,"url":"https://github.com/aosync/init","last_synced_at":"2025-10-08T04:16:07.299Z","repository":{"id":64302093,"uuid":"289226977","full_name":"aosync/init","owner":"aosync","description":"A fast init.","archived":false,"fork":false,"pushed_at":"2020-08-30T20:02:11.000Z","size":20,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T15:48:54.971Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aosync.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}},"created_at":"2020-08-21T09:10:17.000Z","updated_at":"2022-11-30T04:51:44.000Z","dependencies_parsed_at":"2023-01-15T09:31:21.215Z","dependency_job_id":null,"html_url":"https://github.com/aosync/init","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aosync%2Finit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aosync%2Finit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aosync%2Finit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aosync%2Finit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aosync","download_url":"https://codeload.github.com/aosync/init/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243475358,"owners_count":20296712,"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-11-19T12:54:17.684Z","updated_at":"2025-10-08T04:16:02.276Z","avatar_url":"https://github.com/aosync.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# init\n\nA fast init system for Linux.\n\n## Roles of init.\n\nPID 1 action is separated into 3 phases.\n\n### Phase 0\n\n- The base filesystems (`/dev`, `/proc`, `/sys`, `/run`) are mounted.\n- System entropy is seeded with a sample of last run entropy preserved at `/var/entropy`.\n- Hostname is fetched from `/etc/hostname` and is set.\n\nThe rest of phase 0 is delegated to programs located at `/etc/init/0`, they are executed sequentially and in a synchronous manner to ensure everything is ready for phase 1.\nA notable program of phase 0 is `mounts`, which essentially reads from fstab.\n\n### Phase 1\n\nPhase 1 sets up less critical and less important stuff for the userland.\n\nPrograms located at `/etc/init/1/once` are executed once and in an asynchronous manner, in the background.\nPrograms located at `/etc/init/1/repeat` are executed in an asynchronous manner and in the background, but they get respawned when one exits.\n\n`1/repeat` can thus be used as a very minimal service manager, or can be used to manage another service manager such as `runsvdir`.\n\nPID 1 is also now ready to reap orphaned child processes (zombies).\n\n### Phase 2\n\nPhase 2 ensures the system shutdown or reboot to be proceeded in an orderly fashion. It is triggered when PID 1 receives SIGUSR1 or SIGUSR2.\n\nA sample of the system entropy is preserved and stored at `/var/entropy`, then programs located at `/etc/init/2` are executed in a synchronous manner. A sync(2) syscall is issued then the init calls for the shutdown or reboot.\n\n## Installation\n\n```sh\nmake\nmake DESTDIR=\"/usr\" install\n```\n\n## Signals\n\nSIGUSR1 causes shutdown and SIGUSR2 causes reboot.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faosync%2Finit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faosync%2Finit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faosync%2Finit/lists"}