MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / is_server_running

Method is_server_running

src/server/lifecycle.rs:19–30  ·  view source on GitHub ↗

Check if a server is already running

(&self)

Source from the content-addressed store, hash-verified

17
18 /// Check if a server is already running
19 pub fn is_server_running(&self) -> bool {
20 let pid_file = self.tsk_env.pid_file();
21
22 if !pid_file.exists() {
23 return false;
24 }
25
26 match self.read_pid() {
27 Some(pid) => self.is_process_alive(pid),
28 None => false,
29 }
30 }
31
32 /// Write current process PID to file
33 pub fn write_pid(&self) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {

Callers 2

executeMethod · 0.80
runMethod · 0.80

Calls 3

pid_fileMethod · 0.80
read_pidMethod · 0.80
is_process_aliveMethod · 0.80

Tested by

no test coverage detected