<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Hi all</p>
<p><br>
</p>
<p>Chronosync uses ndn-cxx logging facility (wrapper around boost logging facility).</p>
<p><br>
</p>
<p>Now I want to use NLSR based on Chronosync (instead of the old fork, Nsync).</p>
<p><br>
</p>
<p>NLSR has the option to daemonize. So I start nfd and run nlsr -d to daemonize NLSR (number of threads 2).</p>
<p>Then I stop NFD and NLSR gets an error (<span>ERROR: error while receiving data from socket (End of file)</span>).</p>
<p>But ps shows that NLSR is still running, with number of threads as 1.</p>
<p>I attach gdb to it and have attached the bt output.</p>
<p><br>
</p>
<p>I do not have this problem when NLSR is not daemonized.</p>
<p>Seems like it is happening because boost logging facility does not support fork:</p>
<p><span><a href="http://www.boost.org/doc/libs/1_63_0/libs/log/doc/html/log/rationale/fork_support.html" class="OWAAutoLink" id="LPlnk108330" previewremoved="true">http://www.boost.org/doc/libs/1_63_0/libs/log/doc/html/log/rationale/fork_support.html</a></span><span style="font-size: 12pt;">?</span></p>
<p><br>
</p>
<p>Any suggestions or comments?</p>
<p>(I am not sure why NLSR runs as daemon, <a href="https://redmine.named-data.net/issues/1795" class="OWAAutoLink" id="LPlnk716276" previewremoved="true">https://redmine.named-data.net/issues/1795</a> does not provide much rationale other than backgrounding.
 Also NLSR does not close stdout when daemonizing</p>
<p><a href="https://github.com/named-data/NLSR/blob/master/src/nlsr.cpp#L153" class="OWAAutoLink" id="LPlnk911339" previewremoved="true">https://github.com/named-data/NLSR/blob/master/src/nlsr.cpp#L153</a>).</p>
<p><br>
</p>
<p>Thanks</p>
<p>Ashlesh</p>
</div>
</body>
</html>