There is
# Allow file descriptor inheritance
local $^F = 1023;
in Mojo/IOLoop/Server.pm that causes the behavior.
Commenting it out restores expected behavior ($^F=2)
but such a modification of core file makes Mojo unsuitable for my project
or I guess any project that spawns server/daemon type subprocesses.
On Wednesday, 13 February 2019 16:42:09 UTC+1, Wes wrote:
>
> Hi,
>
> I have similar problem.
>
> I tried morbo, hypnotoad, running Mojolicious as root and regular user,
> tried the 'reuse=0' flag, system perl 5.16.3 and custom perl 5.28.1
> I also tried $^F=2 in startup script and just before system call
> but it looks like O_CLOEXEC is not working (t/run/cloexec is ok) and
> children spawned from Mojo app (either with system or backticks) inherit
> parent port *:3000
>
> # ss -tlnp |grep *:3000
> LISTEN 0 128 *:3000 *:*
>
>
> users:(("java",pid=18853,fd=3),("script/server",pid=12847,fd=3),("script/server",pid=1860,fd=3))
>
> If I stop and try to start morbo it complains that the spawned process
> uses morbo's port:
>
> $ morbo -w lib script/server .
> Can't create listen socket: Address already in use at
> /home/user/perl5/lib/perl5/Mojo/IOLoop.pm line 124.
>
> Can you recommend a way to auto close FDs (all or >2) for all spawned
> processes?
>
> Thank you,
> Wes
>
>
--
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 https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.