Closed CristiCimpianu closed 8 years ago
Did you tried to run coova in foreground mode ? using -f
argument ?
It may be the same problem as in #106 .
The problem is related to when closing all output/input in daemon mode, i guess.
@gbaligh Running in foreground mode will probably hide this issue, which btw is probably also linked to https://github.com/coova/coova-chilli/issues/51. The patch you applied still has a problem that it closes stdin and links new_socket to stdin. if any logs will be printed by the child they will be sent to new_socket. I think the only 'clean' solution would be to separate the fd duplication from the redir_fork function and use that only when calling _options.uamui scripts. Also using the FD_CLOEXEC flag on most descriptors may be useful.
Hi @CristiCimpianu , Thanks for your indication, but it's not me who closed the issue ;) And I have no right to reopen it, if @wlanmac can reopen it it will be nice.
I puled the first part of your work, because it's me who did the safe_close(new_socket);
before redir_main()
.
The second par related to stdin and stdout. if it's working in foreground mode, I think it's better to check this part in chilli.c
@CristiCimpianu This is still happening on the latest Git master? It's not clear to me which version are you using.
@ynezz I'm always rebasing on the latest master. As long as there is no logging from the child process everything is fine. Once you enable logging in the fork child my rsyslog sends messages only to stdout (which is now the http/s socket) and breaks the connection. In the fork parent all rsyslog messages go to /var/log/messages. I removed also the LOG_PERROR flag from the syslog connection with no luck.
@CristiCimpianu Hm strange, I've redirssl + uamuissl enabled and it works for me.
I think, that if you're able to compile it yourself and you can find a working tag/revision in the past which was working for you, then the fastest way to find the bug and fix it is to use git bisect
.
@ynezz do you have coova running with any logs (-d flag, debugfacility, loglevel)? Without logging it works for me too.
Hi guys,
I'm kind of stuck trying to enable redirssl due to a problem I tracked down in redir_fork. It goes as follows:
In my case the chilli process has the following fds:
Now a few things I noticed:
From these I deduce that fd 0 in my case is actually the syslog socket, while fd 1 is used by the child to send some data back to the client so closing them is a bad idea. However redir_fork is used in 4 more places and there's also the case with _options.uamui being called and I assume it expects the http(s) socket to be linked to its stdin and stdout. So far I can't think of a clean solution to cover all cases. I will continue trying to search for one next week, but I thought some advice from you will surely help me out.
The minimal set of working changes I did is the following:
thanks in advance, Cristian.