On Mon, 27 Apr 2015, Dan Book wrote:

> What do you mean by "in-line"? I'm not sure I follow the question.

I would like to have a file called 'run', which I can start using './run', 
which will start up in prefork mode, using listen parameters which are 
specified within the file 'run'.

> The prefork command takes command-line options:
> https://metacpan.org/pod/Mojolicious::Command::prefork

Yes, I know, but I would rather have one file than two, so I don't need a 
shell script which just does:

#! /bin/sh
./my_command prefork -l http://127.0.0.1:3006 -w 10 -c 1 [etc]

With hypnotoad I can have one file with:

...
#! /usr/bin/hypnotoad -foreground
...
app->config(hypnotoad => {listen => ['http://127.0.0.1:3006'], workers 
=> 3});
...

> Otherwise if you just need hypnotoad to stay in the foreground (and you
> don't need hot-deployment) you can use hypnotoad -f.

As we've discussed recently on this list, hypnotoad doesn't play nicely 
under process supervisors such as runit, daemontools, etc. prefork was the 
recommended option.

https://groups.google.com/forum/#!msg/mojolicious/sgUj3obB6eU/HdTCgMhzrvYJ

> On Mon, Apr 27, 2015 at 4:11 PM, Charlie Brady <
> [email protected]> wrote:
> 
> >
> > I see in Cookbook this standalone M::L app running under hypnotoad.
> >
> > ...
> > use Mojolicious::Lite;
> >
> > app->config(hypnotoad => {listen => ['http://*:80']});
> >
> > get '/' => {text => 'Hello Wor...ALL GLORY TO THE HYPNOTOAD!'};
> >
> > app->start;
> > ...
> >
> > I want to do something very similar, but using prefork mode (to behave
> > nicely under runit supervision, where the parent process is expected to
> > survive until terminated).
> >
> > I can't find a way to configure mode and options in-line, rather than
> > provided via @ARGV.
> >
> > Thanks for your advice...
> >
> 
> 

Reply via email to