mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +00:00
fix: Cleanup by sending a command and kill when dropped (#1945)
* fix: Cleanup by sending a command and kill when dropped * chore: Fix the loadModule run command * fix: cleans up failed health * refactor long-running * chore: Fixes?" * refactor * run iso ci on pr * fix debuild * fix tests * switch to libc kill * kill process by parent * fix graceful shutdown * recurse submodules * fix compat build * feat: Add back in the timeout * chore: add the missing types for the unnstable * inherited logs Co-authored-by: J M <Blu-J@users.noreply.github.com> * fix deleted code Co-authored-by: Aiden McClelland <me@drbonez.dev> Co-authored-by: J M <Blu-J@users.noreply.github.com>
This commit is contained in:
@@ -10,7 +10,6 @@ bollard = "0.13.0"
|
||||
color-eyre = "0.6.1"
|
||||
ed25519-dalek = { version = "1.0.1", features = ["serde"] }
|
||||
mbrman = "0.5.0"
|
||||
embassy_container_init = { path = "../embassy_container_init" }
|
||||
emver = { version = "0.1", git = "https://github.com/Start9Labs/emver-rs.git", features = [
|
||||
"serde",
|
||||
] }
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
use std::fmt::Display;
|
||||
|
||||
use crate::InvalidId;
|
||||
use color_eyre::eyre::eyre;
|
||||
use patch_db::Revision;
|
||||
use rpc_toolkit::{hyper::http::uri::InvalidUri, yajrc::RpcError};
|
||||
use rpc_toolkit::hyper::http::uri::InvalidUri;
|
||||
use rpc_toolkit::yajrc::RpcError;
|
||||
|
||||
use crate::InvalidId;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum ErrorKind {
|
||||
|
||||
@@ -7,7 +7,6 @@ mod interface_id;
|
||||
mod invalid_id;
|
||||
mod package_id;
|
||||
mod procedure_name;
|
||||
mod type_aliases;
|
||||
mod version;
|
||||
mod volume_id;
|
||||
|
||||
@@ -20,6 +19,5 @@ pub use interface_id::*;
|
||||
pub use invalid_id::*;
|
||||
pub use package_id::*;
|
||||
pub use procedure_name::*;
|
||||
pub use type_aliases::*;
|
||||
pub use version::*;
|
||||
pub use volume_id::*;
|
||||
|
||||
@@ -14,6 +14,7 @@ pub enum ProcedureName {
|
||||
AutoConfig(PackageId),
|
||||
Health(HealthCheckId),
|
||||
Action(ActionId),
|
||||
Signal,
|
||||
}
|
||||
|
||||
impl ProcedureName {
|
||||
@@ -31,6 +32,7 @@ impl ProcedureName {
|
||||
ProcedureName::Action(id) => Some(format!("{}Action", id)),
|
||||
ProcedureName::Check(_) => None,
|
||||
ProcedureName::AutoConfig(_) => None,
|
||||
ProcedureName::Signal => None,
|
||||
}
|
||||
}
|
||||
pub fn js_function_name(&self) -> Option<String> {
|
||||
@@ -47,6 +49,7 @@ impl ProcedureName {
|
||||
ProcedureName::Action(id) => Some(format!("/action/{}", id)),
|
||||
ProcedureName::Check(id) => Some(format!("/dependencies/{}/check", id)),
|
||||
ProcedureName::AutoConfig(id) => Some(format!("/dependencies/{}/autoConfigure", id)),
|
||||
ProcedureName::Signal => Some("/handleSignal".to_string()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
use std::{future::Future, pin::Pin, sync::Arc, time::Duration};
|
||||
|
||||
use embassy_container_init::RpcId;
|
||||
use tokio::sync::mpsc::UnboundedSender;
|
||||
|
||||
/// Used by the js-executor, it is the ability to just create a command in an already running exec
|
||||
pub type ExecCommand = Arc<
|
||||
dyn Fn(
|
||||
String,
|
||||
Vec<String>,
|
||||
UnboundedSender<embassy_container_init::Output>,
|
||||
Option<Duration>,
|
||||
) -> Pin<Box<dyn Future<Output = Result<RpcId, String>> + 'static>>
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
>;
|
||||
|
||||
/// Used by the js-executor, it is the ability to just create a command in an already running exec
|
||||
pub type TermCommand = Arc<
|
||||
dyn Fn(RpcId) -> Pin<Box<dyn Future<Output = Result<(), String>> + 'static>>
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
>;
|
||||
Reference in New Issue
Block a user