python-daemon doesn't call the start function
<p>I've been following the <a href="https://www.python.org/dev/peps/pep-3143/#example-usage" rel="nofollow">this example</a> to implement a python daemon, and it seems to be somewhat working, but only the reconfigure function is called.</p>

<p>This is the code I've been using:</p>

<pre><code>import signal
import daemon
import lockfile

import manager

context = daemon.DaemonContext(
    working_directory='/home/debian/station',
    pidfile=lockfile.FileLock('/var/run/station.pid'))

context.signal_map = {
    signal.SIGTERM: manager.Manager.program_terminate,
    signal.SIGHUP: 'terminate',
    signal.SIGUSR1: manager.Manager.program_reload_configuration,
    }

manager.Manager.program_configure()

with context:
    manager.Manager.program_start()
</code></pre>

<p>This is the code on the manager class:</p>

<pre><code>@staticmethod
def program_configure():
    logging.info('Configuring program')

@staticmethod
def program_reload_configuration():
    logging.info('Reloading configuration')

@staticmethod
def program_start():
    global Instance
    logging.info('Program started')
    Instance = Manager()
    Instance.run()

@staticmethod
def program_terminate():
    logging.info('Terminating')
</code></pre>

<p>And the log shows only:</p>

<pre><code>INFO:root:Configuring program
</code></pre>

<p>For some reason <code>program_start()</code> isn't being called. 
<code>program_configure()</code> is called every time the python file is read, so that's that, but why isn't <code>program_start()</code> called?</p>

<p>I start the daemon by typing <code>sudo service station.sh start</code> and the line that runs the script is:</p>

<pre><code>python $DAEMON start
</code></pre>

<p>EDIT:
After reading a bit, I've realized that the program probably exits or hangs in <code>context.__enter__()</code> (<code>with</code> calls that). But I have no clue what is causing this</p>