mirror of
https://github.com/containers/youki
synced 2024-05-24 08:26:08 +02:00
601df9ecd3
* Set cgroups path for tenant containers from main container Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com> * Ignore new_user_ns for creating cgroups path Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com> * Remove user_ns param completely Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com> * Add tests in podman rootless for exec Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com> * Fix add_task implementation for cgroups v2 and systemd Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com> * minor refactor in tenant builder Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com> * Add unit test for systemd add_task function Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com> * Fix task addition to properly add tasks via dbus api Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com> * Fix cross cotainers for tests running Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com> --------- Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
37 lines
958 B
Rust
37 lines
958 B
Rust
use super::{serialize::Variant, utils::SystemdClientError};
|
|
use std::collections::HashMap;
|
|
use std::path::PathBuf;
|
|
|
|
pub trait SystemdClient {
|
|
fn is_system(&self) -> bool;
|
|
|
|
fn transient_unit_exists(&self, unit_name: &str) -> bool;
|
|
|
|
fn start_transient_unit(
|
|
&self,
|
|
container_name: &str,
|
|
pid: u32,
|
|
parent: &str,
|
|
unit_name: &str,
|
|
) -> Result<(), SystemdClientError>;
|
|
|
|
fn stop_transient_unit(&self, unit_name: &str) -> Result<(), SystemdClientError>;
|
|
|
|
fn set_unit_properties(
|
|
&self,
|
|
unit_name: &str,
|
|
properties: &HashMap<&str, Variant>,
|
|
) -> Result<(), SystemdClientError>;
|
|
|
|
fn systemd_version(&self) -> Result<u32, SystemdClientError>;
|
|
|
|
fn control_cgroup_root(&self) -> Result<PathBuf, SystemdClientError>;
|
|
|
|
fn add_process_to_unit(
|
|
&self,
|
|
unit_name: &str,
|
|
subcgroup: &str,
|
|
pid: u32,
|
|
) -> Result<(), SystemdClientError>;
|
|
}
|