running a PHP based daemon over SSH?
Hi,
I have a Daemon which is written as a PHP script.
I try to run it on a machine running centos via ssh. I ssh to the
machine, run the daemon, and I can see the Daemon is actually
running.
I then exit the ssh connection and the daemon is killed.
Running C based daemons in the same manner works perfectly.
Any ideas to why this is happening?
Maybe there's something that PHP's fork is not doing properly?
Thanks
Yaron Tadmor
Re: running a PHP based daemon over SSH?
ok... some more info.
I figured out this has to do with stdout and stderr "disappearing" for
the daemon. I can easily reproduce this without the ssh (just running
the script from the terminal and closing the terminal causes the
Daemon to die).
Redirecting all output to /dev/null solves the problem.
So I know this is becoming off-topic for this group, but still...
If anyone has any ideas on why the redirection of stdout and stderr
to /dev/null doesn't happen automatically when the shell exits I'll be
happy to hear.
thanks.