Check whether a process with the given PID is still running.
(pid)
| 438 | |
| 439 | /** Check whether a process with the given PID is still running. */ |
| 440 | function isProcessAlive(pid) { |
| 441 | try { |
| 442 | process.kill(pid, 0); // signal 0 = existence check |
| 443 | return true; |
| 444 | } catch { |
| 445 | return false; |
| 446 | } |
| 447 | } |
| 448 | |
| 449 | /** Write the PID file. */ |
| 450 | function writePid(pid) { |