Hello all,

I wrote a small web application using the awesome Mojolicious framework :)
One of the purposes was to run different profiles of the application based 
on different config files.
I'm using Gentoo Linux so I decided to use the idea which Gentoo use for 
init scripts.

I wrote the following:
sub get_config_name {
    my $self = shift;                                                       
                      
    my $exe  = $0;
    my $fp   = File::Spec->rel2abs($exe);                                   
                      
    my $base = basename($exe);                                             
                       
    my @dir  = File::Spec->splitdir($fp);                                   
                      

    return File::Spec->catfile($self->home, 'etc', "$base.conf");           
                      
}

In this case I was making something like:
cd script
ln -s my_web_app new_instance

And created config file with name: new_instance.conf in "etc" folder.
After that I was running "./script/new_instance daemon" and everything 
worked as I expected.

Just recently my application grew up a bit and I decided to move to 
Hypnotoad.
First issue which I met was here (Mojo::Server::Hypnotoad):
 # Remember executable and application for later
  $ENV{HYPNOTOAD_EXE} ||= $0;
  $0 = $ENV{HYPNOTOAD_APP} ||= abs_path $app;
Due to the abs_path (which is making readlink inside) wrong application 
were running.
I've changed a runner a bit:
    $ENV{'HYPNOTOAD_APP'} = $app;
But got to another issue (Mojo::Server):
  # Clean environment (reset FindBin defensively)
  {
    local $0 = $path = abs_path $path;

So my question is: Is there an intention to use abs_path here instead of 
File::Spec->rel2abs?
May I expect that Mojo::Server to be patched? Or should I look to another 
ways of making different instances?
Or maybe you have any suggestions?

p.s. Currently looking into hard links instead of symlinks.

-- 
Thanks,
cono aka Alex

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to