- Rust 97.6%
- Shell 2%
- Just 0.4%
|
Kate the Gay
3d96689ac3
All checks were successful
ci/woodpecker/push/test Pipeline was successful
|
||
|---|---|---|
| .cargo | New error system | |
| .vscode | Allow for poweroff, reboot, and halt commands | |
| .woodpecker | Install lexpect in CI | |
| crates | Format code | |
| docs | Update email address | |
| scripts | Use lexpect instead of expect | |
| src | Allow for poweroff, reboot, and halt commands | |
| units | Rework loader | |
| .gitignore | Remove libguestfs test dependency | |
| Cargo.lock | Update crates | |
| Cargo.toml | Use Rust 2024 | |
| justfile | Add cargo test to just test | |
| LICENSE | Update license | |
| readme.md | Update readme | |
Kanit
Toy init system
Testing
To test Kanit, the following dependencies are needed:
qemu(qemu-system-x86_64)expectcurlrustjust
Once all dependencies are installed, Kanit can be tested in a vm by running just.
The vm's password is set to nothing by default.
Controller
Kanit can be controlled with kanit.
Units
Units are written in TOML and can be loaded for next boot with kanit service enable <unit> [level].
They must be stored at /etc/kanit to be found by kanit. Units are only ran at boot.
Units can be disabled at next boot with kanit service disable <unit> [level] and all enabled units can be
displayed with kanit service list.
Blame
The time each unit takes to run can be viewed with kanit blame (or sorted with kanit blame -s).
Power
The system can be powered off, rebooted, halted, and rebooted with kexec with kanit <op> with an
optional -f flag to bypass the init. In addition, the standard poweroff, reboot, and halt
commands can be used.
Goal
Kanit aims to be minimal with the ability to be rolled into a single executable (multicall).
Todo
(In no particular order)
- Fix compiling with
x86_64-unknown-linux-gnu - Service supervision
kanit-supervisor- Avoid spawning new process and integrate directly into
init - Record logs
- Dynamically loading units
- Move
kanit-rc/services/*to unit files instead - Allow unit files to be baked into the init
- Allow unit files to be loaded at startup
- Move
- (Re)loading units
- Configuration
- Enabled units list
- Concurrency
- More graceful fail over
- Emergency shell
- Allow for continuing when unit fails to start
- Allow for panic recovery (unable to do with
panic = "abort")
- Split
kanit-rc/src/initto separate crate - Consider moving
kanit-rc/init/*to unit files *devmdevudev
- Testing
- Smoke test
- Unit tests
- Syslog
- Busybox
- Custom
- Logging
- Startup logger
- Runtime logger
- Shutdown
Credit
- OpenRC/Alpine for init scripts