Answer the question
In order to leave comments, you need to log in
How to run multiple php daemons at the same time?
Good afternoon. To perform certain tasks, I run php daemon scripts (with content like while(1) {.....}), go to Putty, execute the screen command, then php script.php and close Putty. There are 4 such scripts and sometimes you have to restart them all, doing the above procedure for each.
How to do it more correctly and how to automate the launch of several daemons?
Answer the question
In order to leave comments, you need to log in
You need to write a bash script, in it the process flies into the background and the process id is obtained, then it is written to the pid file, when stopping and restarting, the id is taken from the file, the process must also be unhooked from the current terminal, for this the disown command.
Google it, if you're interested - I can look at my scripts at home as I did.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question