Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

--background clobbers log

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


catalyst at sethdaniel

Feb 7, 2012, 3:55 PM

Post #1 of 4 (296 views)
Permalink
--background clobbers log

Hello,

I'm still working on a small program that demonstrates this, but here is
a problem I am seeing:

Catalyst 5.90007
Log::Log4perl 1.35
CatalystX::Script::Server::Starman 0.01


I setup logging in my app as suggested in the Catalyst::Log perldoc:

__PACKAGE__->log( Log::Log4perl::Catalyst->new('log.conf') );
__PACKAGE__->setup;


I then start the server with a script that looks like:

BEGIN {
$ENV{CATALYST_SCRIPT_GEN} = 40;
}

use Catalyst::ScriptRunner;
Catalyst::ScriptRunner->run('MyApp', 'Server');


And that script load another module that loads
CatalystX::Script::Server::Starman and eventually starman starts.

package MyApp::Script::Server;
use Moose;
extends 'CatalystX::Script::Server::Starman';
1;
__END__

All of this works. However, when I specify --background and --pidfile
the logging will be sent to the pidfile after startup (startup logging
goes to the file specified in log.conf; all following logging gets sent
to the pidfile). If --background is specified without --pidfile I have
no idea where the logging gets sent, but it doesn't get sent to the
log file specified in log.conf.

Anybody else seen this or have any idea what's going on? I'm currently
working on a small program that demonstrates this but it may be a day
before I can really get to that.

Thanks for any assistance.

--
seth /\ sethdaniel.org

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


bobtfish at bobtfish

Feb 8, 2012, 12:24 AM

Post #2 of 4 (274 views)
Permalink
Re: --background clobbers log [In reply to]

On 7 Feb 2012, at 23:55, Seth Daniel wrote:
>
> Anybody else seen this or have any idea what's going on? I'm
> currently
> working on a small program that demonstrates this but it may be a day
> before I can really get to that.
>
> Thanks for any assistance.


I've seen something similar reported on irc (but an actual bug report
- or demonstration never followed through).

I can guess what's going on here - which is that --background is
closing file handles you don't want to to close, this would be the
fault of MooseX::Demonize (or our use thereof).

This is a core bug (not a bug in the starman script or log4perl) -
even if you don't get any further, can you report an RT so it doesn't
get lost?

Cheers
t0m


_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


catalyst at sethdaniel

Feb 8, 2012, 9:39 AM

Post #3 of 4 (278 views)
Permalink
Re: --background clobbers log [In reply to]

On Wed, Feb 08, 2012 at 08:24:03AM +0000, Tomas Doran wrote:
>
> On 7 Feb 2012, at 23:55, Seth Daniel wrote:
>>
>> Anybody else seen this or have any idea what's going on? I'm
>> currently
>> working on a small program that demonstrates this but it may be a day
>> before I can really get to that.
>>
>> Thanks for any assistance.
>
>
> I've seen something similar reported on irc (but an actual bug report -
> or demonstration never followed through).
>
> I can guess what's going on here - which is that --background is closing
> file handles you don't want to to close, this would be the fault of
> MooseX::Demonize (or our use thereof).
>
> This is a core bug (not a bug in the starman script or log4perl) - even
> if you don't get any further, can you report an RT so it doesn't get
> lost?

https://rt.cpan.org/Public/Bug/Display.html?id=74786

I amended my initial report to this list by mentioning I am using
MooseX::Daemonize 0.13.

Not necessarily related but I have noticed another (more minor) problem.
It seems by the time starman starts the @ARGV has either been clobbered
or is not being passed correctly to starman. Looking at the starman
code the $0 should be set to "starman master @ARGV" or "starman worker
@ARGV", but instead it's just "starman master" or "starman worker".

--
seth /\ sethdaniel.org

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


catalyst at sethdaniel

Feb 8, 2012, 11:30 AM

Post #4 of 4 (273 views)
Permalink
Re: --background clobbers log [In reply to]

On Wed, Feb 08, 2012 at 09:39:14AM -0800, Seth Daniel wrote:
> On Wed, Feb 08, 2012 at 08:24:03AM +0000, Tomas Doran wrote:
> >
> > On 7 Feb 2012, at 23:55, Seth Daniel wrote:
> >>
> >> Anybody else seen this or have any idea what's going on? I'm
> >> currently
> >> working on a small program that demonstrates this but it may be a day
> >> before I can really get to that.
> >>
> >> Thanks for any assistance.
> >
> >
> > I've seen something similar reported on irc (but an actual bug report -
> > or demonstration never followed through).
> >
> > I can guess what's going on here - which is that --background is closing
> > file handles you don't want to to close, this would be the fault of
> > MooseX::Demonize (or our use thereof).
> >
> > This is a core bug (not a bug in the starman script or log4perl) - even
> > if you don't get any further, can you report an RT so it doesn't get
> > lost?
>
> https://rt.cpan.org/Public/Bug/Display.html?id=74786
>
> I amended my initial report to this list by mentioning I am using
> MooseX::Daemonize 0.13.

I've attached a small tarball to this e-mail. From the root of the dist
run:
$ start_app --background --pidfile /tmp/app-server.pid

Once it has started you can
$ wget http://localhost:3000

You can then see in app-server.pid that logging is now going there and
not to app-server.log.

If I figure out how I will append this to the RT ticket as well.
--
seth /\ sethdaniel.org
Attachments: app-background-bug.tar (10.0 KB)

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.