I pushed the I/O redirection block down for darwin as for some reason I
am not seeing any errors with it. It doesn’t make any sense to have a
daemon that pushes to tty when you explicitly double fork in order to
avoid attaching to a tty in the future.

close() those file pointers created for redirection.

some open() instances changed to use “with” context manager

restart() does not work and will probably be removed in the future.

exceptions in get_pid are passed up to be dealt accordingly

changed an os.kill() call for a sys.exit(). As it standed we were
calling os.kill() on the same process and that did not allow atexit to
work properly. More changes will happen in the future around this area.