Yes, I do mean the HTTP port, and yes, Mojo would be handling that. It's been noted before that FD_CLOEXEC doesn't seem to be working as expected with Mojo (if indeed it is set by default by perl, as I have seen asserted - it is disabled by default on sockets and fds in socket() and open()). So maybe my expectation that Mojo should set FD_CLOEXEC is misguided.
https://www.perlmonks.org/?node_id=1013743 On Wed, 6 Feb 2019, Nuno Mota wrote: > 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 > > > > > > > > > >
