diag: print pipe() error details in service.spawn
This commit is contained in:
+8
-1
@@ -47,7 +47,14 @@ impl Service {
|
||||
}
|
||||
command.envs(base_envs).envs(&self.envs);
|
||||
|
||||
let (mut read_pipe, write_pipe) = io::pipe().unwrap();
|
||||
let (mut read_pipe, write_pipe) = io::pipe().unwrap_or_else(|e| {
|
||||
eprintln!("INIT_DIAG: pipe() failed: {} (errno {})", e, e.raw_os_error().unwrap_or(-1));
|
||||
match std::fs::OpenOptions::new().read(true).open("/scheme/pipe") {
|
||||
Ok(_f) => eprintln!("INIT_DIAG: /scheme/pipe open ok"),
|
||||
Err(e2) => eprintln!("INIT_DIAG: /scheme/pipe open failed: {} (errno {})", e2, e2.raw_os_error().unwrap_or(-1)),
|
||||
}
|
||||
panic!("pipe() failed in service.spawn for {}: {}", self.cmd, e)
|
||||
});
|
||||
unsafe { pass_fd(&mut command, "INIT_NOTIFY", write_pipe.into()) };
|
||||
|
||||
let mut child = match command.spawn() {
|
||||
|
||||
Reference in New Issue
Block a user