-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no way to keep daemon running #4
Comments
I have seen the same issue on FreeBSD 10/11-Current |
I tested bricks-server (daemon-mode). It did not give me any issues. I have a few follow-up questions: 1- In your script file (startup-one-thread.lua), did you uncomment lines 140 and 142? If you did not, then the bricks server will simply parse the file (function definitions) and then will gracefully terminate the process. Please do not uncomment lines 144 and 146 since this will destroy the engine and kill the bricks daemon. 2- If you are correctly following step 1, then something else is causing the problem. Can you please edit src/main.c line 200:
to:
and then recompile the entire program with debugging flags (gmake clean; gmake debug)? |
On FreeBSD 11 (technically hardenedbsd 11): Everything looks fine in /tmp/bricks.log, until the end:
I will email you the bricks.log file. I made your changes to make sure init() and start() run, with the following configured for the simple load balancer (interface em1):
debug output on command line:
I also turned on netmap verbose mode and there are no errors reported, only that the pipes are disconnected from em1:
|
I did an install of FreeBSD 10, with the same test setup from your recommendation, and it appears to daemonize and function with tcpdump. However, in testing with tcpdump with em1{0 and em1{1, there is a state when detaching causes a kernel panic (on 10 stable, separate issue maybe). I verified that this kqueue error occurs on FreeBSD 11 and HardenedBSD 11 only. |
note: all testing involved the single-thread lua scripts. |
Okay, Thanks! It seems that the netmap I/O does not play well with epoll()/kqueue() system calls. I may have to end up revising the networking backend of the bricks soon. For the time being, I suggest that you replace line 362 of src/main.c:
to:
This is a dirty hack but I do plan to start revising the bricks framework in the coming days. |
Netmap should play well with kqueue. The netmap team has indicated that their epoll support isn't complete yet though. Luigi will be in Berkeley next month and we can discuss these sorts of troubles more then. |
Okay. I will narrow down the issue. Let me check if the same problem occurs on a Linux machine as well. |
I tried your fix on FreeBSD 11 (HardenedBSD)
and it resolves the issue. The single thread brick ran for an hour, and then I tested running bro with 4 interfaces on an under-powered VM and things seem stable. The multi-thread setup starts and runs, but seems to only use 2 threads in the brick process. I have also restarted bro several times, to ensure I am not seeing kernel panics when leaving netmap mode. I sent a pull request to fix the FreeBSD compile issue, but let me know if you need testing for additional fixes. Thanks for your help and clarification on this. |
I updated the backend code recently. bricks-server in FreeBSD should now work fine. Let me know if you see any other issues |
I've tried a bunch of ways to keep the bricks-server up and running, but it seems like as soon as it finishes running the file specific in -f it exits the bricks process (since there is no drop to bricks console).
If I toss a loop into the lua script, it pegs a core completely and the packet engine doesn't load balance.
The text was updated successfully, but these errors were encountered: