For a website, I need to start and stop the daemon process. What I'm doing now is
exec("sudo /etc/init.d/daemonToStart start");
The daemon process is running, but Apache / PHP freezes. Running ps aux showed that sudo itself has become a zombie process, effectively killing all further successes. Is this normal behavior when trying to start daeomon from PHP?
And yes, Apache has the right to run the command /etc/init.d/daemonToStart . I modified the / etc / sudoers file so that it does. No, I did not allow Apache to execute any command, just a few to make the site work.
In any case, returning to my question, is there a way to allow PHP to run daemons in such a way that a zombie process is not created? I ask about this because when I do the opposite, stopping the already running daemon, it works fine.
php daemon zombie-process
Thame90
source share