libsysf -> sysf + complete unit type
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
450e604518
commit
f8858501d7
@ -1,13 +1,13 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "libsysf"
|
||||
name = "sysf"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "sysf-init"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"libsysf 0.1.0",
|
||||
"sysf 0.1.0",
|
||||
]
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
[workspace]
|
||||
members = [
|
||||
"libsysf",
|
||||
"sysf",
|
||||
"sysf-init"
|
||||
]
|
||||
|
@ -1,13 +0,0 @@
|
||||
#[allow(dead_code)]
|
||||
pub struct Unit {
|
||||
description: String,
|
||||
documentation: Vec<String>,
|
||||
wants: Vec<String>,
|
||||
requires: Vec<String>,
|
||||
requisite: Vec<String>,
|
||||
binds_to: Vec<String>,
|
||||
part_of: Vec<String>,
|
||||
conflicts: Vec<String>,
|
||||
before: Vec<String>,
|
||||
after: Vec<String>,
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "systemf"
|
||||
name = "sysf"
|
||||
version = "0.1.0"
|
||||
|
||||
[lib]
|
||||
crate-type = "dylib"
|
@ -1,5 +1,6 @@
|
||||
[package]
|
||||
name = "libsysf"
|
||||
name = "sysf"
|
||||
version = "0.1.0"
|
||||
authors = ["eater <=@eater.me>"]
|
||||
edition = "2018"
|
||||
edition = "2018"
|
||||
crate-type = "dylib"
|
@ -0,0 +1,128 @@
|
||||
use crate::unit::JobMode::Replace;
|
||||
use crate::time::{TimeSpan, FiniteTimeSpan};
|
||||
use crate::time::TimeSpan::Infinite;
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub struct Unit {
|
||||
description: String,
|
||||
|
||||
// Space only
|
||||
documentation: Vec<String>,
|
||||
|
||||
// Space -and- list
|
||||
wants: Vec<String>,
|
||||
requires: Vec<String>,
|
||||
requisite: Vec<String>,
|
||||
binds_to: Vec<String>,
|
||||
part_of: Vec<String>,
|
||||
|
||||
// Space only
|
||||
conflicts: Vec<String>,
|
||||
|
||||
// Space -and- list
|
||||
before: Vec<String>,
|
||||
after: Vec<String>,
|
||||
|
||||
// Space only
|
||||
on_failure: Vec<String>,
|
||||
|
||||
// Space -and- list
|
||||
propagates_reload_to: Vec<String>,
|
||||
propagates_reload_from: Vec<String>,
|
||||
joins_namespace_of: Vec<String>,
|
||||
requires_mounts_for: Vec<String>,
|
||||
|
||||
on_failure_job_mode: JobMode,
|
||||
|
||||
ignore_on_isolate: bool,
|
||||
stop_when_unneeded: bool,
|
||||
refuse_manual_start: bool,
|
||||
refuse_manual_stop: bool,
|
||||
allow_isolate: bool,
|
||||
default_dependencies: bool,
|
||||
collect_mode: CollectMode,
|
||||
failure_action: UnitAction,
|
||||
success_action: UnitAction,
|
||||
failure_action_exit_status: u8,
|
||||
success_action_exit_status: u8,
|
||||
job_timeout_sec: TimeSpan,
|
||||
job_running_timeout_sec: TimeSpan,
|
||||
job_timeout_action: UnitAction,
|
||||
job_timeout_reboot_argument: Option<String>,
|
||||
start_limit_interval_sec: FiniteTimeSpan,
|
||||
start_limit_burst: usize,
|
||||
start_limit_action: UnitAction,
|
||||
reboot_argument: Option<String>,
|
||||
source_path: Option<String>,
|
||||
}
|
||||
|
||||
impl Default for Unit {
|
||||
fn default() -> Self {
|
||||
Unit {
|
||||
description: "".to_string(),
|
||||
documentation: vec![],
|
||||
wants: vec![],
|
||||
requires: vec![],
|
||||
requisite: vec![],
|
||||
binds_to: vec![],
|
||||
part_of: vec![],
|
||||
conflicts: vec![],
|
||||
before: vec![],
|
||||
after: vec![],
|
||||
on_failure: vec![],
|
||||
propagates_reload_to: vec![],
|
||||
propagates_reload_from: vec![],
|
||||
joins_namespace_of: vec![],
|
||||
requires_mounts_for: vec![],
|
||||
on_failure_job_mode: Replace,
|
||||
ignore_on_isolate: false,
|
||||
stop_when_unneeded: false,
|
||||
refuse_manual_start: false,
|
||||
refuse_manual_stop: false,
|
||||
allow_isolate: false,
|
||||
default_dependencies: true,
|
||||
collect_mode: CollectMode::Inactive,
|
||||
failure_action: UnitAction::None,
|
||||
success_action: UnitAction::None,
|
||||
failure_action_exit_status: 0,
|
||||
success_action_exit_status: 0,
|
||||
job_timeout_sec: Infinite,
|
||||
job_running_timeout_sec: Infinite,
|
||||
job_timeout_action: UnitAction::None,
|
||||
job_timeout_reboot_argument: None,
|
||||
start_limit_interval_sec: Default::default(),
|
||||
start_limit_burst: 0,
|
||||
start_limit_action: UnitAction::None,
|
||||
reboot_argument: None,
|
||||
source_path: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum JobMode {
|
||||
Fail,
|
||||
Replace,
|
||||
ReplaceIrreversibly,
|
||||
Isolate,
|
||||
Flush,
|
||||
IgnoreDependencies,
|
||||
IgnoreRequirements,
|
||||
}
|
||||
|
||||
enum CollectMode {
|
||||
Inactive,
|
||||
InactiveOrFailed,
|
||||
}
|
||||
|
||||
enum UnitAction {
|
||||
None,
|
||||
Reboot(UnitActionSeverity),
|
||||
PowerOff(UnitActionSeverity),
|
||||
Exit(UnitActionSeverity),
|
||||
}
|
||||
|
||||
enum UnitActionSeverity {
|
||||
None,
|
||||
Force,
|
||||
Immediate,
|
||||
}
|
Loading…
Reference in New Issue