From 9109290c69f388592df54b40efc77fd54d1a16bf Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Tue, 30 Jan 2018 19:51:00 +0000 Subject: [PATCH] daemon : do not start the daemon if the PID file is finished by a \n git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4093 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- daemon.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon.php b/daemon.php index 3b73451..377ca66 100644 --- a/daemon.php +++ b/daemon.php @@ -51,7 +51,7 @@ class daemon $this->runDir), 500); if ($file->file_exists ($this->runDir."/$name.pid")) { - $pid = $file->file_get_contents ($this->runDir."/$name.pid"); + $pid = trim ($file->file_get_contents ($this->runDir."/$name.pid")); if (file_exists ("/proc/$pid")) throw new \Exception (sprintf ( "Can't start the daemon: already running with PID %d", $pid), 500);