{"id":13789076,"url":"https://github.com/cemkeylan/shinit","last_synced_at":"2025-07-16T10:33:45.032Z","repository":{"id":215865132,"uuid":"249680421","full_name":"cemkeylan/shinit","owner":"cemkeylan","description":"Basic Init Daemon in POSIX sh","archived":false,"fork":false,"pushed_at":"2020-07-17T12:02:57.000Z","size":8,"stargazers_count":25,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-12T03:43:51.007Z","etag":null,"topics":["daemon","init","posix-sh","poweroff","reboot","shell","signal"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/cemkeylan.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}},"created_at":"2020-03-24T10:39:46.000Z","updated_at":"2024-11-21T02:03:38.000Z","dependencies_parsed_at":"2024-01-07T04:05:34.300Z","dependency_job_id":"f17eee2d-4889-4033-b5b7-29bcb0b267a2","html_url":"https://github.com/cemkeylan/shinit","commit_stats":null,"previous_names":["cemkeylan/shinit"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cemkeylan/shinit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cemkeylan%2Fshinit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cemkeylan%2Fshinit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cemkeylan%2Fshinit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cemkeylan%2Fshinit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cemkeylan","download_url":"https://codeload.github.com/cemkeylan/shinit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cemkeylan%2Fshinit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260294461,"owners_count":22987624,"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":["daemon","init","posix-sh","poweroff","reboot","shell","signal"],"created_at":"2024-08-03T21:00:58.287Z","updated_at":"2025-06-17T05:08:00.238Z","avatar_url":"https://github.com/cemkeylan.png","language":"Shell","readme":"shinit\n======\n\nBasic init daemon in POSIX sh with only 5 lines of code. It supports acting upon\nsignals.\n\nOn USR1 signal it will poweroff, and on INT signal it will reboot.\n\n\nInstalling\n----------\n\nBefore installing, edit the second command to use your boot/poweroff script. If\nyou are using Carbs Linux or KISS, you don't need to change it.\n\nYou can then install with `make`.\n\n    make install\n\n\nNote on halting the system\n--------------------------\n\nshinit does **NOT** deal with system halting. You will need an extra utility for\nthat given purpose. `ubase halt` deals with this. You can also use compile\nthis really simple C program that tells to kernel to shutdown or reboot.\n\n``` c\n#include \u003csys/reboot.h\u003e\n\nint\nmain(int argc, char *argv[])\n{\n    switch ((int) argv[argc \u003c 2 ? 0 : 1][0]) {\n    case 'p': reboot(RB_POWER_OFF); break;\n    case 'r': reboot(RB_AUTOBOOT);  break;\n    default: return 1;\n    }\n    return 0;\n}\n```\n\nYou can compile the following program to something named `halt` or whatever you\nlike. If you call `halt p` it will power off, if you call `halt r` it will\nreboot. Just note that this needs to be at the end of your init script, because\nthis command will shut your computer down straight away. You can do the\nfollowing check at the end of your init script:\n\n``` sh\ncase \"$1\" in\n    poweroff) halt p ;;\n    reboot)   halt r ;;\nesac\n```\n","funding_links":[],"categories":["Software"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcemkeylan%2Fshinit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcemkeylan%2Fshinit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcemkeylan%2Fshinit/lists"}