/DragonReach/src/executor/ |
H A D | mod.rs | 7 unit::UnitState, 65 let mut unit = mutex.lock().unwrap(); in exec() localVariable 68 for id in unit.unit_base().unit_part().on_failure() { in exec() 73 unit.unit_base_mut().set_state(UnitState::Failed); in exec() 74 unit.after_exit(ExitStatus::Failure); in exec() 82 let unit = match UnitManager::get_unit_with_id(&unit_id) { in exec_() localVariable 89 let mut unit = unit.lock().unwrap(); in exec_() localVariable 97 for u in unit.unit_base().unit_part().after() { in exec_() 107 for u in unit.unit_base().unit_part().requires() { in exec_() 117 for u in unit.unit_base().unit_part().binds_to() { in exec_() [all …]
|
/DragonReach/src/manager/ |
H A D | mod.rs | 19 for unit in running_manager.mut_running_table() { in check_running_status() 20 let proc = unit.1; in check_running_status() 25 *unit.0, in check_running_status() 34 exited_unit.push((*unit.0, ExitStatus::from_exit_code(!0))); in check_running_status() 60 let unit = UnitManager::get_unit_with_id(&tmp.0).unwrap(); in check_running_status() localVariable 61 unit.lock().unwrap().after_exit(tmp.1); in check_running_status() 66 let unit = UnitManager::pop_a_idle_service(); in check_running_status() localVariable 67 match unit { in check_running_status() 68 Some(unit) => { in check_running_status() 69 let _ = unit.lock().unwrap().run(); in check_running_status()
|
/DragonReach/src/manager/ctl_manager/ |
H A D | mod.rs | 13 use crate::unit::Unit; 14 use crate::unit::UnitState; 111 for unit in units { in list_unit() 112 res = format!("{}\n{}", res, unit.lock().unwrap().unit_base().unit_info()); in list_unit() 126 Some(unit) => { in stop() 127 unit.lock().unwrap().exit(); in stop() 142 Some(unit) => unit.lock().unwrap().run()?, in start() 145 let unit = UnitManager::get_unit_with_id(&i).unwrap(); in start() localVariable 146 let mut unit = unit.lock().unwrap(); in start() localVariable 147 unit.run()?; in start() [all …]
|
/DragonReach/src/executor/dep_graph/ |
H A D | mod.rs | 6 unit::Unit, 83 fn add_edges(&mut self, unit: usize, after: &[usize]) { in add_edges() 87 let s = self.add_node(unit); in add_edges() 92 let unit = arc_unit.lock().unwrap(); in add_edges() localVariable 93 let after = unit.unit_base().unit_part().after(); in add_edges() 99 pub fn construct_graph(unit: &Arc<Mutex<dyn Unit>>) -> DepGraph { in construct_graph() 102 let unit = unit.lock().unwrap(); in construct_graph() localVariable 103 let uid = unit.unit_id(); in construct_graph() 105 let after = (&unit).unit_base().unit_part().after(); in construct_graph()
|
/DragonReach/src/manager/unit_manager/ |
H A D | mod.rs | 8 use crate::unit::Unit; 54 pub fn insert_into_name_table(path: &str, unit: usize) { in insert_into_name_table() 58 NAME_TO_UNIT_MAP.write().unwrap().insert(hash, unit); in insert_into_name_table() 131 pub fn insert_unit_with_id(id: usize, unit: Arc<Mutex<dyn Unit>>) { in insert_unit_with_id() 134 map.insert(id, unit); in insert_unit_with_id() 196 for (id, unit) in manager.iter() { in init_units_dependencies() 197 let mut unit = unit.lock().unwrap(); in init_units_dependencies() localVariable 198 let before = unit.unit_base_mut().unit_part().before(); in init_units_dependencies() 206 for (id, unit) in manager.iter() { in init_units_dependencies() 207 let mut unit = unit.lock().unwrap(); in init_units_dependencies() localVariable [all …]
|
/DragonReach/src/parse/graph/ |
H A D | mod.rs | 5 unit::UnitType, 104 pub fn construct_graph(unit: String) -> Result<Graph, ParseError> { in construct_graph() 108 Self::get_node_num(&unit, &mut dep, &mut node_num)?; in construct_graph() 113 graph.add_node(&unit); in construct_graph() 114 let after = Self::parse_after(&unit); in construct_graph() 116 graph.add_edges(&unit, after); in construct_graph() 121 unit, in construct_graph() 148 for unit in units { in parse_after() 149 ret.push(String::from(unit)); in parse_after()
|
/DragonReach/src/unit/timer/ |
H A D | mod.rs | 10 use crate::unit::UnitState; 59 let unit_is_running = UnitManager::is_running_unit(&part.unit); in init() 153 if self.check() && UnitManager::contains_id(&self.timer_part.unit) { in run() 159 } else if !UnitManager::contains_id(&self.timer_part.unit) { in run() 185 if UnitManager::is_running_unit(&part.unit) { in _run() 191 if let Ok(_) = Executor::exec(part.unit) { in _run() 201 let unit: Arc<Mutex<TimerUnit>> = Arc::new(Mutex::new(self.clone())); in _init() localVariable 202 TimerManager::push_timer_unit(unit); in _init() 217 if UnitManager::is_running_unit(&part.unit) //在运行就不管了 in check() 227 if let Some(_) = UnitManager::get_unit_with_id(&part.unit) { in check() [all …]
|
/DragonReach/src/parse/ |
H A D | mod.rs | 7 use crate::unit::timer::TimerUnitAttr; 8 use crate::unit::{BaseUnit, Unit}; 12 unit::{service::ServiceUnitAttr, BaseUnitAttr, InstallUnitAttr, UnitType}, 250 let unit = UnitManager::get_unit_with_name(&name).unwrap(); in parse() localVariable 251 let unit = unit.lock().unwrap(); in parse() localVariable 252 return Ok(unit.unit_id()); in parse() 255 let mut unit: T = T::default(); in parse() localVariable 363 if let Err(e) = unit.set_attr(segment, attr_str, val_str) { in parse() 373 unit.set_unit_base(unit_base); in parse() 374 unit.set_unit_name(name.clone()); in parse() [all …]
|
/DragonReach/src/manager/timer_manager/ |
H A D | mod.rs | 7 error::runtime_error::RuntimeError, time::timer::Timer, unit::timer::TimerUnit, unit::Unit, 52 pub fn push_timer_unit(unit: Arc<Mutex<TimerUnit>>) { in push_timer_unit() 54 let mut unit_guard = unit.lock().unwrap(); in push_timer_unit() 66 .insert(unit_id, unit); //加入到inner_timers_map in push_timer_unit()
|
/DragonReach/src/unit/ |
H A D | mod.rs | 448 let unit = UnitParseUtil::parse_unit_no_type(unit_path)?; in set_attr() localVariable 449 self.conflicts.push(unit); in set_attr() 541 let unit = UnitParseUtil::parse_unit::<TargetUnit>(unit_path)?; in set_attr() localVariable 542 self.requires_by.push(unit); in set_attr() 549 let unit = UnitParseUtil::parse_unit_no_type(unit_path)?; in set_attr() localVariable 550 self.also.push(unit); in set_attr() 557 let unit = UnitParseUtil::parse_unit::<TargetUnit>(unit_path)?; in set_attr() localVariable 558 self.wanted_by.push(unit); in set_attr()
|
/DragonReach/src/executor/service_executor/ |
H A D | mod.rs | 10 unit::{ 40 let unit = mutex.lock().unwrap(); in exec_simple() localVariable 41 if *unit.unit_base().state() == UnitState::Active { in exec_simple() 44 unit.unit_base().unit_part().description() in exec_simple()
|
/DragonReach/src/parse/parse_util/ |
H A D | mod.rs | 7 unit::{service::ServiceUnit, target::TargetUnit, timer::TimerUnit, Unit, UnitType, Url}, 452 let unit = match suffix { in parse_unit_no_type() localVariable 462 return Ok(unit); in parse_unit_no_type() 585 let unit: &str; in parse_sec() localVariable 612 unit = &frac_and_unit[val..]; in parse_sec() 626 unit = ""; in parse_sec() 644 unit = &s[idx..]; in parse_sec() 657 unit = ""; in parse_sec() 664 let factor = match SEC_UNIT_TABLE.get(unit) { in parse_sec()
|
/DragonReach/src/time/timer/ |
H A D | mod.rs | 3 use crate::{error::runtime_error::RuntimeError, unit::timer::TimerUnit};
|
/DragonReach/src/ |
H A D | main.rs | 9 mod unit; module
|
/DragonReach/src/systemctl/ctl_parser/ |
H A D | mod.rs | 3 use crate::unit::{UnitState, UnitType};
|