README.md (1207B)
1 minit - mini init 2 ================= 3 4 A small init daemon inspired by sinit[1] 5 with basic halting capabilities. 6 7 Building and installing 8 ----------------------- 9 10 minit can be configured from config.h before 11 compile time. After editing you can simply build 12 and install with 13 14 make 15 make install 16 17 Usage Note 18 ---------- 19 20 This halting capability adds 2 signals to 21 the init daemon, SIGUSR2 and SIGQUIT. Keep 22 in mind that you do not want to send these 23 signals standalone, as they will power your 24 computer off, they will not run through your 25 init scripts or anything. You must send these 26 signals from the init scripts so your computer 27 shuts down (or reboots) after you deal with the 28 delicate parts of your shutdown process. 29 30 31 Controlling minit 32 ----------------- 33 34 You can add some basic poweroff/reboot programs 35 so you don't have to remember which signal to send 36 with your kill command. 37 38 A basic poweroff would be 39 40 #!/bin/sh 41 /bin/kill -s USR1 1 42 43 A basic reboot would be 44 45 #!/bin/sh 46 /bin/kill -s INT 1 47 48 49 On your init script, you can add something like 50 51 case "$1" in 52 reboot) /bin/kill -s QUIT 1 ;; 53 poweroff) /bin/kill -s USR2 1 ;; 54 esac 55 56 [1]: https://git.suckless.org/sinit