Re: Redirecting STDERR to a file?
| From: | js | Date: | Sat, 02 Feb 2008 09:29:28 +0000 |
| Subject: | Re: Redirecting STDERR to a file? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-268558@lists.php.net to get a copy of this message | ||
nohup would work in some ways, but that's not a real daemon
because the process will have tty, in a session and has a process group.
I like to have a real daemon.
On Feb 2, 2008 5:25 PM, Per Jessen <per@computer.org> wrote:
> js wrote:
>
> > I was trying to write a script in PHP that takes a program name
> > as an argument and invoke it as a daemon.
> > PHP provides fork(pcntl_fork), setsid(posix_setsid) and umask,
> > so it was easy.
> > However, I couldn't find a way to redirect STDERR a file.
> > I like to have the daemon write its log to its own logfile, like
> > apache and mysql do.
>
> I think "nohup <program> 2>errorlog" will do what you're after.
>
>
> /Per Jessen, Zürich
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>