lopter / lightsd

A daemon with a JSON-RPC API to control your light bulbs
GNU General Public License v3.0
129 stars 15 forks source link

The `-d/--daemonize' option doesn't work on *BSD #16

Open lopter opened 8 years ago

lopter commented 8 years ago

kqueue(2) file descriptors aren't inherited by child processes therefore we need to fork before we call event_base_new from libevent.

This is pretty annoying because it means we need to rework lightsd's initialization process.

A quick hack/workaround by replacing fork with rfork(RFPROC), also seems to indicate that signal handling isn't working once in the background.

Thanks @kraduk for reporting this issue.