Page 1 of 1

Function like exec() without waiting for execution

Posted: Thu Oct 02, 2008 6:24 pm
by nextguy
Hi all,

im looking for a function like exec() or system() that will not wait until the command is executed? I could not find any function in the manual that has this behavior.

Re: Function like exec() without waiting for execution

Posted: Thu Oct 02, 2008 6:42 pm
by josh
invoke the command thru nohup ( launches linux processes immune to a hangup signal )

syntax

nohup ./command > output.out &

you should redirect the output somewhere, and the & tells the process to run in the background. Technically what you need is the & not the nohup, but the nohup would stop that process from dying if apache got restarted or something