[plug] Logrotate Killing Apache
Bernard Blackham
bernard at blackham.com.au
Mon Oct 24 11:30:41 WST 2005
On Mon, Oct 24, 2005 at 09:16:11AM +0800, Timothy White wrote:
> > > apache runs the modem control application
> >
> > I guess so :)
> >
> > Presumably pppd is inheriting the FDs from apache. Perhaps make a
> > wrapper script with something like:
> >
> > #!/bin/sh
> > exec 3>&- 4>&- 5>&- 6>&- 7>&- 8>&- 9>&- 10>&-
> > exec /usr/sbin/pppd "$@"
>
> I'm currently using PHP to start the dialup connection. (So
> system('pon Optus');)
> What does the first exec do in your script? I gather it closes the FD's?
Yep. Ideally there'd be some way to close all FDs, but I don't know
one yet and haven't looked hard. Leaving FD 2 open is useful as it
means error output will go to apache's error.log
> I find it a /little/ stupid that FD's should be passed through a
> system call in php, but I'll check when I get a chance.
Yeah, it's probably bugworthy. At least the FDs should be marked
close-on-exec.
Bernard.
--
Bernard Blackham <bernard at blackham dot com dot au>
More information about the plug
mailing list