File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -152,3 +152,16 @@ function process_is_running($keyword)
152152 return empty ($ output ) ? false : true ;
153153}
154154
155+ /**
156+ * @param $port
157+ * @return bool
158+ */
159+ function port_is_running ($ port )
160+ {
161+ $ command = "lsof -i: {$ port } | grep LISTEN " ;
162+
163+ exec ($ command , $ output );
164+
165+ return !empty ($ output );
166+ }
167+
Original file line number Diff line number Diff line change @@ -519,7 +519,8 @@ public function isRunning()
519519 if (file_exists ($ this ->config ['pid_file ' ])) {
520520 return posix_kill (file_get_contents ($ this ->config ['pid_file ' ]), 0 );
521521 }
522- return process_is_running ("{$ this ->name } master " );
522+
523+ return process_is_running ("{$ this ->name } master " ) && port_is_running ($ this ->port );
523524 }
524525
525526 /**
You can’t perform that action at this time.
0 commit comments