[Nfd-dev] Re-basing NLSR on Chronosync

Junxiao Shi shijunxiao at email.arizona.edu
Sun Apr 2 17:25:41 PDT 2017


Hi Ashlesh

Boost.Log document says: "As long as the forked process doesn't try to use
any of Boost.Log code"…
Thus, you can make sure ndn-cxx logging facility is initialized before
forking, and log levels are all set to none, so that Boost.Log functions
are never involved after forking.

Otherwise, just stop daemonizing, and do the same as NFD, so that Boost.Log
can work correctly.

Yours, Junxiao


On Mar 31, 2017 9:33 AM, "Ashlesh Gawande (agawande)" <agawande at memphis.edu>
wrote:

Hi all


Chronosync uses ndn-cxx logging facility (wrapper around boost logging
facility).


Now I want to use NLSR based on Chronosync (instead of the old fork, Nsync).


NLSR has the option to daemonize. So I start nfd and run nlsr -d to
daemonize NLSR (number of threads 2).

Then I stop NFD and NLSR gets an error (ERROR: error while receiving data
from socket (End of file)).

But ps shows that NLSR is still running, with number of threads as 1.

I attach gdb to it and have attached the bt output.


I do not have this problem when NLSR is not daemonized.

Seems like it is happening because boost logging facility does not support
fork:

http://www.boost.org/doc/libs/1_63_0/libs/log/doc/html/log/
rationale/fork_support.html?


Any suggestions or comments?

(I am not sure why NLSR runs as daemon, https://redmine.named-
data.net/issues/1795 does not provide much rationale other than
backgrounding. Also NLSR does not close stdout when daemonizing

https://github.com/named-data/NLSR/blob/master/src/nlsr.cpp#L153).


Thanks

Ashlesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/nfd-dev/attachments/20170402/4019a6e7/attachment.html>


More information about the Nfd-dev mailing list