Skip to content

Commit

Permalink
Merge branch 'containers:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
kemkemG0 authored Apr 7, 2023
2 parents 409d8b1 + 399058a commit f4641b9
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 33 deletions.
46 changes: 23 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![codecov](https://codecov.io/gh/containers/youki/branch/main/graph/badge.svg)](https://codecov.io/gh/containers/youki)

<p align="center">
<img src="docs/youki_flat_full.png" width="450">
<img src="docs/youki.png" width="450">
</p>

youki is an implementation of the [OCI runtime-spec](https://github.com/opencontainers/runtime-spec) in Rust, similar to [runc](https://github.com/opencontainers/runc).
Expand Down
2 changes: 1 addition & 1 deletion crates/libcontainer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cgroupsv2_devices = ["libcgroups/cgroupsv2_devices"]

[dependencies]
anyhow = "1.0"
bitflags = "2.0.2"
bitflags = "2.1.0"
caps = "0.5.5"
chrono = { version = "0.4", features = ["serde"] }
crossbeam-channel = "0.5"
Expand Down
24 changes: 17 additions & 7 deletions crates/libcontainer/src/process/container_main_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ use crate::{
rootless::Rootless,
utils,
};
use anyhow::{Context, Result};
use anyhow::{bail, Context, Result};
use nix::sys::wait::{waitpid, WaitStatus};
use nix::unistd::Pid;

#[cfg(feature = "libseccomp")]
use crate::seccomp;
#[cfg(feature = "libseccomp")]
use nix::{
errno::Errno,
sys::socket::{self, UnixAddr},
unistd::{self},
unistd,
};
#[cfg(feature = "libseccomp")]
use oci_spec::runtime;
Expand Down Expand Up @@ -107,15 +108,24 @@ pub fn container_main_process(container_args: &ContainerArgs) -> Result<Pid> {
// process is exit and reaped. By this point, the intermediate process
// should already exited successfully. If intermediate process errors out,
// the `init_ready` will not be sent.
match waitpid(intermediate_pid, None)? {
WaitStatus::Exited(_, 0) => (),
WaitStatus::Exited(_, s) => {
match waitpid(intermediate_pid, None) {
Ok(WaitStatus::Exited(_, 0)) => (),
Ok(WaitStatus::Exited(_, s)) => {
log::warn!("intermediate process failed with exit status: {s}");
}
WaitStatus::Signaled(_, sig, _) => {
Ok(WaitStatus::Signaled(_, sig, _)) => {
log::warn!("intermediate process killed with signal: {sig}")
}
_ => (),
Ok(_) => (),
Err(err) => {
// This is safe because intermediate_process and main_process check if the process is
// finished by piping instead of exit code.
if err == Errno::ECHILD {
log::warn!("intermediate process already reaped");
} else {
bail!("failed to wait for intermediate process: {err}");
}
}
};

Ok(init_pid)
Expand Down
Binary file added docs/archive/youki.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
Binary file modified docs/src/assets/youki.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/src/youki.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Youki

<p align="center">
<img src="./assets/youki_flat_full.png" width="450">
<img src="./assets/youki.png" width="450">
</p>

youki is an implementation of the [OCI runtime-spec](https://github.com/opencontainers/runtime-spec) in Rust, similar to [runc](https://github.com/opencontainers/runc).
Expand Down
Binary file modified docs/youki.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/youki_flat_full.png
Binary file not shown.

0 comments on commit f4641b9

Please sign in to comment.