0.9.x nodaemon backport (rebase of #144 to 0.9.x branch)