I created a cronjob which call a php-script every 5mins.
This PHP script needs to start several other PHP CLI scripts and keep them running in background even when the cron-script terminates.
I'm currently creating these sub-processes by the following line of code:
if (!$pid = shell_exec("nohup /var/[..]/cake.php test doSomething > /dev/null 2>&1 & echo $!")) return false;
When I call the "motherscript" via command-line everything's working great. But it seems like the sub-processes startet by the above line of code are terminated when the cron-job stops.
So how to spawn these cake.php test doSomethingscript and keep the child-process running under the predefined user in crontab?