MCPcopy Create free account
hub / github.com/ermak-dev/cloudpub / install

Method install

client/src/service/linux.rs:39–59  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

37
38impl ServiceManager for LinuxServiceManager {
39 fn install(&self) -> Result<()> {
40 // Copy config to system location
41 self.config.copy_config_to_system()?;
42
43 // Create the service file
44 self.create_service_file()?;
45
46 // Reload systemd to recognize the new service
47 Command::new("systemctl")
48 .args(["daemon-reload"])
49 .status()
50 .context("Failed to reload systemd")?;
51
52 // Enable the service to start on boot
53 Command::new("systemctl")
54 .args(["enable", &self.config.name])
55 .status()
56 .context("Failed to enable service")?;
57
58 Ok(())
59 }
60
61 fn uninstall(&self) -> Result<()> {
62 // Stop the service if it's running

Callers 1

handle_service_commandFunction · 0.45

Calls 3

copy_config_to_systemMethod · 0.80
create_service_fileMethod · 0.80
statusMethod · 0.45

Tested by

no test coverage detected