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

Method uninstall

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

Source from the content-addressed store, hash-verified

59 }
60
61 fn uninstall(&self) -> Result<()> {
62 // Stop the service if it's running
63 let _ = self.stop();
64
65 // Disable the service
66 Command::new("systemctl")
67 .args(["disable", &self.config.name])
68 .status()
69 .context("Failed to disable service")?;
70
71 // Remove the service file
72 if Path::new(&self.service_file_path()).exists() {
73 fs::remove_file(self.service_file_path()).context("Failed to remove service file")?;
74 }
75
76 // Reload systemd
77 Command::new("systemctl")
78 .args(["daemon-reload"])
79 .status()
80 .context("Failed to reload systemd")?;
81
82 Ok(())
83 }
84
85 fn start(&self) -> Result<()> {
86 Command::new("systemctl")

Callers 1

handle_service_commandFunction · 0.45

Calls 3

service_file_pathMethod · 0.80
stopMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected