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

Method create_service_file

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

Source from the content-addressed store, hash-verified

21 }
22
23 fn create_service_file(&self) -> Result<()> {
24 let executable = self.config.executable_path.to_string_lossy();
25 let args = self.config.args.join(" ");
26
27 // Replace placeholders in the template
28 let service_content = SYSTEMD_SERVICE_TEMPLATE
29 .replace("{DESCRIPTION}", &self.config.description)
30 .replace("{EXECUTABLE}", &executable)
31 .replace("{ARGS}", &args);
32
33 fs::write(self.service_file_path(), service_content)
34 .context("Failed to write systemd service file")
35 }
36}
37
38impl ServiceManager for LinuxServiceManager {

Callers 1

installMethod · 0.80

Calls 1

service_file_pathMethod · 0.80

Tested by

no test coverage detected