After a lot of reading, I've managed to close all the sockets on the fork
itself, after setsid(). That did the trick.

I'm assuming the fd you are talking is the HTTP port itself, because that's
the one hooked on my daemon.
That would be Mojo handling it, am I wrong?

Regards,
Nuno Mota



Charlie Brady <[email protected]> escreveu no dia quarta,
6/02/2019 à(s) 15:36:

>
> You can find the file descriptor of the listen socket using 'fd' from
> the daemon.
>
> https://mojolicious.org/perldoc/Mojo/Server/Daemon
>
> Make sure that the close-on-exec flag is set on that fd. That should be
> the default on perl, but maybe it isn't on your platform, or maybe
> Mojolicious for some reason clears it...
>
> https://perldoc.perl.org/Fcntl.html
>
> On Tue, 5 Feb 2019, Nuno Mota wrote:
>
> > Hi,
> > I'm having an issue with port bindings from my Mojolicious perl daemon.
> >
> > The thing is, I issue a restart through Mojo, which then runs a bash
> script
> > that restarts a daemon.
> > After this daemon starts, it's hooked on the Mojo HTTP port. Does this
> make
> > any sense?
> >
> > perl      8883     root   16u  IPv4  91544      0t0  TCP *:8080 (LISTEN)
> > daemon   9053     root   16u  IPv4  91544      0t0  TCP *:8080 (LISTEN)
> >
> > I've tried exec, system, backticks and nothing seems to properly detach
> the
> > bash script from the Mojo port hooks.
> >
> > Regards,
> > Nuno
> >
> >
>

-- 
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.

Reply via email to