{"id":20849797,"url":"https://github.com/ulfox/cinit","last_synced_at":"2025-07-25T08:03:13.485Z","repository":{"id":113578586,"uuid":"413310512","full_name":"ulfox/cinit","owner":"ulfox","description":"Container sys init","archived":false,"fork":false,"pushed_at":"2021-10-17T21:13:09.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-08T23:07:03.277Z","etag":null,"topics":["containers","docker","go","golang","init","init-system","process-manager","task-manager"],"latest_commit_sha":null,"homepage":"","language":"Go","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/ulfox.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}},"created_at":"2021-10-04T07:06:06.000Z","updated_at":"2025-02-28T09:25:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"f32a8725-e8ae-4603-a1b7-296437c84022","html_url":"https://github.com/ulfox/cinit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulfox%2Fcinit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulfox%2Fcinit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulfox%2Fcinit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulfox%2Fcinit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ulfox","download_url":"https://codeload.github.com/ulfox/cinit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243213981,"owners_count":20254902,"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":["containers","docker","go","golang","init","init-system","process-manager","task-manager"],"created_at":"2024-11-18T03:06:48.894Z","updated_at":"2025-03-12T12:18:33.804Z","avatar_url":"https://github.com/ulfox.png","language":"Go","readme":"# GO CInit\n\nContainer sys init\n\n\n## Please read this first\n\n```\n    Do not run this on your personal comupter directly without Devmod, only within a container. \n    If you want to run it from your personal host, run it with -dev mode. \n    Without Devmod, on exit it will send SIGTERM and SIGKILL (on timeout) to all your processes. \n    Check Devmod run section for how to run with Devmod enabled\n```\n\n## Build\n\nBuild cinitd\n\n```bash\n    $\u003e make cinitd\n\n    #./bin/cinit-daemon -h\n```\n\nBuild cinit cli\n\n```bash\n    $\u003e make cli\n\n    #./bin/cinit -h\n```\n\n## Devmod run (Not a PID 1 process)\n\n\nVia Makefile\n\n```bash\n    $\u003e make run\n```\n\nManually\n\n```bash\n    $\u003e go run cinitd/cinitd.go -dev\n```\n\nExpected output\n\n```bash\n    $\u003e go run cinitd/cinitd.go -dev\n    INFO[0000] Initiated                                     Component=Cinitd\n    INFO[0000] Server initializing                           Component=SocketServer Stage=Init\n```\n\n## Run as PID 1\n\nTo run as PID 1, simply build cinitd and run it **without adding flag: -dev** \n\n## Using Cinit CLI\n\nCinit CLI uses http connection to interact with cinitd. In the future this will change to GRCP but for now it's http, sorry for that :(\n\n### List Services\n\n```bash\n    $\u003e ./bin/cinit -list\n    No services\n```\n\n### Register a new service\n\nCheck `docs/examples/service.yaml`\n\n```bash\n    $\u003e cat docs/examples/service.yaml\n    name: command1\n    command: sleep\n    args: 10000\n```\n\nRegister the above service\n\n```bash\n    $\u003e ./bin/cinit -register -f docs/examples/service.yaml\n    Service command1 has been registered\n```\nExpected cinitd events\n\n```bash\nINFO[0015] Registered new task            Component=ProcessPoolManager Part=TaskListener\nDEBU[0015] Expanding ProcessPool          Component=ProcessPoolManager Part=Expanding\nDEBU[0015] Received task. Pushing to next available process handler  Component=ProcessPoolManager Part=Binding\nDEBU[0015] ProcessHandler 6... has been created  Component=ProcessPoolManager Part=ProcessQueue\nINFO[0015] Task is being executed         Component=ProcessHandler Name=command1 PID=17584 PUID=6... Part=Running\n```\n\n### Get service status\n\nFirst get a list of services\n\n```bash\n    $\u003e ./bin/cinit -list\n    {\"Services\":[\"command1\"]}\n```\n\nGet service **command1** status\n\n```bash\n    $\u003e ./bin/cinit -status -name command1\n    {\"action\":\"status\",\"name\":\"command1\",\"pid\":\"17584\",\"status\":\"running\",\"startTime\":\"2021-10-17T14:56:02.056110357Z\"}\n```\n\n### Stop a service\n\n\n```bash\n    $\u003e ./bin/cinit -stop -name command1\n    {\"action\":\"stop\",\"name\":\"command1\",\"status\":\"stopped\",\"startTime\":\"2021-10-17T14:56:02.056110357Z\",\"exitTime\":\"2021-10-17T15:00:14.732705337Z\",\"exitStatus\":\"signal: killed\"}\n```\n\n### Start a service\n\n\n```bash\n    $\u003e ./bin/cinit -stop -name command1\n    {\"action\":\"start\",\"name\":\"command1\",\"pid\":\"17611\",\"status\":\"running\",\"startTime\":\"2021-10-17T15:00:52.833677948Z\"}\n```\n\n### Delete a service\n\n```bash\n    $\u003e ./bin/cinit -stop -name command1\n    {\"action\":\"delete\",\"name\":\"command1\",\"status\":\"deleted\"}\n```\n\n### Exit cinitd\n\n```bash\n    $\u003e kill \u003cpid of cinitd\u003e\n    INFO[0009] Interrupted            Component=Cinitd\n    INFO[0009] Sent 29 bytes to cinitd                      \n    INFO[0009] Bye!            Component=SocketServer\n    INFO[0009] Bye!            Component=\"HTTP Server\"\n    INFO[0009] Bye!            Component=ServiceOperator Part=ServiceListener\n    INFO[0009] Bye!            Component=ServiceOperator\n    INFO[0009] Bye!            Component=ProcessPoolManager Part=TaskListener\n    INFO[0009] Bye!            Component=ProcessPoolManager Part=TaskOperator\n    WARN[0009] ProcessQueue expansion is now forbidden       Component=ProcessPoolManager Part=ProcessQueue\n    INFO[0009] Task has finished: signal: terminated         Component=ProcessHandler Name=command1 PUID=9... Part=Exit\n    WARN[0009] ProcessQueue base has been shrinked to 0      Component=ProcessPoolManager Part=ProcessQueue\n    DEBU[0009] ProcessHandler 9... is shutting down  Component=ProcessPoolManager Part=ProcessQueue\n    INFO[0009] Bye!            Component=ProcessPoolManager Part=ZombieKiller\n    INFO[0009] Bye!            Component=ProcessPoolManager\n    INFO[0009] Bye!            Component=Cinitd\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulfox%2Fcinit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fulfox%2Fcinit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulfox%2Fcinit/lists"}