Item1362: Foswiki/Sandbox.pm tries to close STDERR even if its already closed

pencil
Priority: Enhancement
Current State: No Action Required
Released In:
Target Release: n/a
Applies To: Engine
Component:
Branches:
Reported By: FiSh
Waiting For:
Last Change By: CrawfordCurrie
Hi,

i try to run foswiki under lighttpd with fastcgi.

Now i get this when trying to register a user:

| 2009-03-24T13:21:29Z warning | Registration failed: Can't kill STDERR: 'No such file or directory' at /www/freigeist.org/foswiki/lib/Foswiki/Sandbox.pm line 478.

The code in question is:
            # Child - run the command
            untie(*STDERR);
            open( STDERR, '>', File::Spec->devnull() )
              || die "Can't kill STDERR: '$!'";

            unless ( exec( $path, @args ) ) {
                syswrite( STDOUT, $key . ": $!\n" );
                exit($key);
            }
Lighttpd closes STDERR before forking a (fast-)cgi-process. So I guess the problem is that STDERR is already closed.

Maybe you can safely omit the die() part. If not, you need to check first of STDERR is still open..

--> This whole issue, if i understand it correctly and the real error does not lay somewhere else, renders foswiki on a recent lighttpd pretty useless.. So you may raise the priority..

-- FiSh - 24 Mar 2009

What lighttpd version are you using? What's the result of perl -MFile::Spec -le 'print File::Spec->devnull()'?

-- GilmarSantosJr - 24 Mar 2009

I was going to ask that. Aren't you chroot'ed somewhere and the /dev/null doesn't exist and can't be created?

-- OlivierRaginel - 24 Mar 2009

Woops, you're right. My foswiki is running in a chroot without /dev/null... I created /dev/null and now it seems to work.

But do you really need /dev/null? All other webapps I use here, don't rely on /dev/null.. Maybe you should think about it, so I changed priority to enhancement.

-- FiSh - 25 Mar 2009

No longer uses /dev/null since 1.1

-- CrawfordCurrie - 26 Aug 2010

ItemTemplate edit

Summary Foswiki/Sandbox.pm tries to close STDERR even if its already closed
ReportedBy FiSh
Codebase 1.0.4
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Component
Priority Enhancement
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn
Topic revision: r6 - 26 Aug 2010, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy