pub struct InitSystem { /* private fields */ }Expand description
Init system manager
Implementations§
Source§impl InitSystem
impl InitSystem
Source§impl InitSystem
impl InitSystem
Sourcepub fn initialize(&self) -> Result<(), KernelError>
pub fn initialize(&self) -> Result<(), KernelError>
Initialize the init system
Sourcepub fn register_service(
&self,
definition: ServiceDefinition,
) -> Result<(), KernelError>
pub fn register_service( &self, definition: ServiceDefinition, ) -> Result<(), KernelError>
Register a service
Sourcepub fn start_service(&self, name: &str) -> Result<(), KernelError>
pub fn start_service(&self, name: &str) -> Result<(), KernelError>
Start a service
Sourcepub fn stop_service(&self, name: &str) -> Result<(), KernelError>
pub fn stop_service(&self, name: &str) -> Result<(), KernelError>
Stop a service
Sourcepub fn restart_service(&self, name: &str) -> Result<(), KernelError>
pub fn restart_service(&self, name: &str) -> Result<(), KernelError>
Restart a service
Sourcepub fn get_service_status(&self, name: &str) -> Option<ServiceInfo>
pub fn get_service_status(&self, name: &str) -> Option<ServiceInfo>
Get service status
Sourcepub fn list_services(&self) -> Vec<ServiceInfo>
pub fn list_services(&self) -> Vec<ServiceInfo>
List all services
Sourcepub fn switch_runlevel(&self, runlevel: Runlevel) -> Result<(), KernelError>
pub fn switch_runlevel(&self, runlevel: Runlevel) -> Result<(), KernelError>
Switch runlevel
Sourcepub fn handle_service_exit(&self, pid: ProcessId, exit_code: i32)
pub fn handle_service_exit(&self, pid: ProcessId, exit_code: i32)
Handle service exit
Sourcepub fn shutdown(&self) -> Result<(), KernelError>
pub fn shutdown(&self) -> Result<(), KernelError>
Shutdown the system
Sourcepub fn reboot(&self) -> Result<(), KernelError>
pub fn reboot(&self) -> Result<(), KernelError>
Reboot the system