From 15dad0578aba899211e58ae2acb8835939e7f3b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hozda?= Date: Thu, 26 Sep 2019 13:48:45 +0200 Subject: [PATCH] readme and minor --- README.md | 10 ++++++++++ src/config.rs | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..c1e1c05 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# init-rs + +Should be pretty much a drop-in replacement for `sinit`. Apart from Rust, the difference is that `initrs` is more +talkative and has more checks (for instance checks if init script/command failed). Also allows timeout duration to be customized. + +Disclaimer: I am not sure if my `sig_reap` is 100% correct. + +## Customization + +To customize, edit `src/config.rs`. diff --git a/src/config.rs b/src/config.rs index 608b2c0..cb450c0 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,5 +1,9 @@ +/// time-out duration for SIGALRMs across initrs (all 2 of them) pub static TIMEOUT: u32 = 30; +/// init script/command/program to be ran once initrs initializes pub static INIT_CMD: &'static [&'static str] = &["/bin/rc.init"]; +/// command to reboot pub static REBOOT_CMD: &'static [&'static str] = &["/bin/rc.shutdown", "reboot"]; -pub static POWEROFF_CMD: &'static [&'static str] = &["/bin/rc.init", "poweroff"]; +/// command to shutdown +pub static POWEROFF_CMD: &'static [&'static str] = &["/bin/rc.shutdown", "poweroff"];