nofork and handling concurrent requests

38 views
Skip to first unread message

Michael Soulier

unread,
Jun 17, 2013, 11:53:04 AM6/17/13
to mojol...@googlegroups.com
Hi,

I'd like to supervise a mojolicious daemon providing a service using runit, so the service cannot fork or runsv will simply return. 

But, I'd like to handle concurrent requests if possible. Can prefork or Hypnotoad be told to not fork the parent process? 

Or, is there a better way to do this?

Thanks,
Mike

Charlie Brady

unread,
Jun 17, 2013, 10:14:31 PM6/17/13
to mojol...@googlegroups.com

On Mon, 17 Jun 2013, Michael Soulier wrote:

> Hi,
>
> I'd like to supervise a mojolicious daemon providing a service using runit,
> so the service cannot fork or runsv will simply return.
>
> But, I'd like to handle concurrent requests if possible. Can prefork or
> Hypnotoad be told to not fork the parent process?

Have you tried "--foreground"?

[charlieb@localhost ~]$ hypnotoad --help
usage: /usr/bin/hypnotoad [OPTIONS] [APPLICATION]

hypnotoad script/myapp
hypnotoad myapp.pl

These options are available:
--config <path> Configuration file, defaults to "hypnotoad.conf" in
the
same directory as the application script.
--foreground Keep manager process in foreground.
--help Show this message.
--test Test application/configuration and exit.
[charlieb@localhost ~]$

Found via:

http://www.perlmonks.org/?node_id=979855

Charlie Brady

unread,
Jun 17, 2013, 10:57:23 PM6/17/13
to mojol...@googlegroups.com

On Mon, 17 Jun 2013, Charlie Brady wrote:

> On Mon, 17 Jun 2013, Michael Soulier wrote:
>
> > But, I'd like to handle concurrent requests if possible. Can prefork or
> > Hypnotoad be told to not fork the parent process?
>
> Have you tried "--foreground"?
>
> [charlieb@localhost ~]$ hypnotoad --help
> usage: /usr/bin/hypnotoad [OPTIONS] [APPLICATION]
>
> hypnotoad script/myapp
> hypnotoad myapp.pl

Perhaps the pod could be enhanced:

http://search.cpan.org/~sri/Mojolicious-4.14/script/hypnotoad

SYNOPSIS

$ hypnotoad --help
$ hypnotoad myapp.pl

Michael Soulier

unread,
Jun 17, 2013, 10:46:20 PM6/17/13
to mojol...@googlegroups.com
On 2013-06-17, at 10:14 PM, Charlie Brady <charli...@budge.apana.org.au> wrote:

> Have you tried "--foreground"?

Missed it. Thanks.
Reply all
Reply to author
Forward
0 new messages