Dead processes will be deleted when they are running for more than 9 minutes.

This commit is contained in:
Michael Vogel 2014-05-22 00:16:36 +02:00
parent 58cea13707
commit e32f9c4fff
5 changed files with 31 additions and 8 deletions

View file

@ -28,5 +28,14 @@ class pidfile {
public function is_already_running() {
return $this->_running;
}
public function running_time() {
return(time() - filectime($this->_file));
}
public function kill() {
if (file_exists($this->_file))
return(posix_kill(file_get_contents($this->_file), SIGTERM));
}
}
?>