summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO.md6
-rw-r--r--init/src/host/locale.rs2
-rw-r--r--init/src/kmods/load.rs2
-rw-r--r--init/src/services/units.rs2
-rw-r--r--init/src/signals/sigchld.rs2
5 files changed, 7 insertions, 7 deletions
diff --git a/TODO.md b/TODO.md
index 00208cb..7dc9dc1 100644
--- a/TODO.md
+++ b/TODO.md
@@ -20,10 +20,10 @@
### Core runtime features
- [ ] **Service management**
- - [ ] Parse TOML unit files (`/etc/vigil/units/*.toml`)
+ - [x] Parse TOML unit files (`/etc/vigil/units/*.toml`)
- [ ] Start/stop/restart/status via `vigilctl`
- - [ ] Handle `Wants=`, `After=`, `Before=` dependencies
- - [ ] Auto-restart failed services (configurable via option `restart = always|on-failure|never`)
+ - [x] Handle Runlevels
+ - [x] Auto-restart failed services (configurable via option `restart = always|on-failure|never`)
- [x] **Child process reaping**
- [x] Install `SIGCHLD` handler
- [x] Call `waitpid(-1, ...)` in loop to reap zombies
diff --git a/init/src/host/locale.rs b/init/src/host/locale.rs
index 9ce0a3c..a440792 100644
--- a/init/src/host/locale.rs
+++ b/init/src/host/locale.rs
@@ -1,7 +1,7 @@
// NOTE: Ts file contains setting localisation by environment variables
// Main logic implemented but how i think it can contain with broken logic or checks
// At least if check failed it set C.UTF8 (fallback locale)
-// And why is std::env::set_var unsafe????
+
use crate::host::timezone::set_timezone;
use crate::log::{log_success, log_warning};
diff --git a/init/src/kmods/load.rs b/init/src/kmods/load.rs
index 8ff0a59..164d429 100644
--- a/init/src/kmods/load.rs
+++ b/init/src/kmods/load.rs
@@ -1,4 +1,4 @@
-use liblmod::{modprobe, Selection};
+use liblmod::{Selection, modprobe};
use std::fs;
fn parse_modules() -> Result<Vec<String>, Box<dyn std::error::Error>> {
diff --git a/init/src/services/units.rs b/init/src/services/units.rs
index ffb7900..316a15e 100644
--- a/init/src/services/units.rs
+++ b/init/src/services/units.rs
@@ -139,7 +139,7 @@ pub fn services_mainloop() -> Result<(), Box<dyn std::error::Error + Send>> {
));
// Stops other runlevel services
- pids.retain(|(child, exec, _, _)| {
+ pids.retain_mut(|(child, exec, _, _)| {
// TODO: Correct stop with SIGTERM + timeout
match child.try_wait() {
Ok(Some(_)) => {
diff --git a/init/src/signals/sigchld.rs b/init/src/signals/sigchld.rs
index 79a40c9..d4e3312 100644
--- a/init/src/signals/sigchld.rs
+++ b/init/src/signals/sigchld.rs
@@ -32,7 +32,7 @@ pub fn setup_sigchld_handler() -> Result<(), Box<dyn std::error::Error>> {
unsafe {
let mut sigact: sigaction = std::mem::zeroed();
- sigact.sa_sigaction = sigchld_handler as usize;
+ sigact.sa_sigaction = sigchld_handler as *const () as usize;
sigact.sa_flags = SA_RESTART | SA_SIGINFO;
libc::sigemptyset(&mut sigact.sa_mask as *mut sigset_t);