Subject: Bug#484: Daemonize with systemd needs detach_process=True

From: Bengt Giger <[email-masked]>
Date: Fri, 25 Apr 2014 14:55:42 +0200

Package: x2gobroker
version: 0.0.3

When starting x2gobroker-daemon (and x2gobroker-authservice)
with systemd, the process will not fork. The command

   systemctl start x2gobroker-daemon

will start the daemon but not return to the prompt.

This is caused by the way DaemonContext() handles the
parameter detach_process:

"If unspecified (None) during initialisation of the instance,
this will be set to True by default, and False only if
detaching the process is determined to be redundant; for
example, in the case when the process was started by init,
by initd, or by inetd."

But systemd is not recognized, so detach_process defaults
to False. It has to be explicitely set to True.

I tested the behaviour on Fedora 20, and the daemons both
detach after this change.

Regards
Bengt