Jump to content

Processes


The Little Guy

Recommended Posts

using shell_exec can I run 2+ of the same process on a linux machine?

 

Currently I have this:

$newPort = newPort();
socket_write($client, 'new_port:'.$newPort."\0");
shell_exec('~/processes/mini '.$newPort.' &');

 

what happens, is that it doesn't work if I already have that process running (I think)...

 

is this fixable?

Link to comment
https://forums.phpfreaks.com/topic/193967-processes/
Share on other sites

Yes, I know it hangs, because I placed an echo after it and it doesn't echo it out.

 

I found this:

 

shell_exec("nohup ~/processes/mini $newPort > /dev/null & echo $!");

 

after using it, it no longer hung, and I was able to have 2+ instances of mini running.

 

server is the main client when a user connects to it, it then it routes them to "mini" the actual chatting client. mini opens a port, and those on that port can chat with each other.

 

anyway, if that made any sense ;) is that a good way to do it?

Link to comment
https://forums.phpfreaks.com/topic/193967-processes/#findComment-1021217
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.