add service manager sal

This commit is contained in:
Timur Gordon
2025-07-01 09:11:45 +02:00
parent 717cd7b16f
commit b4e370b668
6 changed files with 751 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
use crate::{ServiceConfig, ServiceManager, ServiceManagerError, ServiceStatus};
use async_trait::async_trait;
#[derive(Debug)]
pub struct SystemdServiceManager;
impl SystemdServiceManager {
pub fn new() -> Self {
Self
}
}
#[async_trait]
impl ServiceManager for SystemdServiceManager {
async fn start(&self, _config: &ServiceConfig) -> Result<(), ServiceManagerError> {
Err(ServiceManagerError::Other("Systemd implementation not yet complete".to_string()))
}
async fn stop(&self, _service_name: &str) -> Result<(), ServiceManagerError> {
Err(ServiceManagerError::Other("Systemd implementation not yet complete".to_string()))
}
async fn restart(&self, _service_name: &str) -> Result<(), ServiceManagerError> {
Err(ServiceManagerError::Other("Systemd implementation not yet complete".to_string()))
}
async fn status(&self, _service_name: &str) -> Result<ServiceStatus, ServiceManagerError> {
Err(ServiceManagerError::Other("Systemd implementation not yet complete".to_string()))
}
async fn logs(&self, _service_name: &str, _lines: Option<usize>) -> Result<String, ServiceManagerError> {
Err(ServiceManagerError::Other("Systemd implementation not yet complete".to_string()))
}
async fn list(&self) -> Result<Vec<String>, ServiceManagerError> {
Err(ServiceManagerError::Other("Systemd implementation not yet complete".to_string()))
}
async fn remove(&self, _service_name: &str) -> Result<(), ServiceManagerError> {
Err(ServiceManagerError::Other("Systemd implementation not yet complete".to_string()))
}
}