Hi!<div><br></div><div>After some code rework, I got it working.</div><div><br></div><div>The trick is that factories aren't supported in UPD, and they work directly in the service creation. </div><div><br></div><div>Flask seems to work in the same way, not needing to be wrapped into any factory or so. However in order not to have a .tac file loaded with the routes and this stuff I've used flask-classy. Half an hour later everything seems to work.</div>

<div><br></div><div>Here is my current tac file:</div><div>-----------------------------------------</div><div>







<p class="p1">from twisted.internet import reactor</p>
<p class="p1">from twisted.application import service, <span class="s1">internet</span></p>
<p class="p1">from twisted.web.server import Site</p>
<p class="p1">from twisted.web.wsgi import WSGIResource</p>
<p class="p1">from flask import Flask</p>
<p class="p1">from server import Server</p>
<p class="p1">from <span class="s1">bootloader</span> import BootLoaderServer</p>
<p class="p1">from restful_api import RestFulApi</p>
<p class="p2"><br></p>
<p class="p1">flask_app = Flask("restfulapi", static_folder="<span class="s1">www</span>", static_url_path="")</p>
<p class="p1">flask_app.debug = True      </p>
<p class="p1">flask_resource = WSGIResource(reactor, reactor.getThreadPool(), flask_app)</p>
<p class="p1">flask_site = Site(flask_resource)</p>
<p class="p1">RestFulApi.register(flask_app)</p>
<p class="p1">server = Server()</p>
<p class="p1">server.load_cfg("default.cfg")</p>
<p class="p1">bootloader_server = BootLoaderServer()</p>
<p class="p1">application = service.Application("<span class="s1">unidosys</span>")</p>
<p class="p1">multi_service = service.MultiService()</p>
<p class="p1">flask_service = internet.TCPServer(8080, flask_site)</p>
<p class="p1">main_service = internet.UDPServer(Server.port, server)</p>
<p class="p1">bootloader_service = internet.UDPServer(BootLoaderServer.multicast_port, bootloader_server) </p>
<p class="p2"><br></p>
<p class="p1">flask_service.setServiceParent(multi_service)</p>
<p class="p1">main_service.setServiceParent(multi_service)</p>
<p class="p1">bootloader_service.setServiceParent(multi_service)</p>
<p class="p1">unidosys_service.setServiceParent(application)</p><p class="p1"><br class="Apple-interchange-newline">-----------------------------------------</p><p class="p1">So far so good ;).</p><p class="p1">Thanks for your kind help and for this fantastic framework.</p>

<p class="p1">All the best, Beth.</p></div><div><br><div class="gmail_quote">On 2 July 2013 21:29, Glyph <span dir="ltr"><<a href="mailto:glyph@twistedmatrix.com" target="_blank">glyph@twistedmatrix.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><div><div>On Jul 2, 2013, at 12:02 PM, Beth <<a href="mailto:beth.null@gmail.com" target="_blank">beth.null@gmail.com</a>> wrote:</div>


<br><blockquote type="cite"><div style="font-family:Menlo-Regular;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">


Can someone give me a hand in how to daemonize one application?</div></blockquote><br></div><blockquote type="cite"><div style="font-family:Menlo-Regular;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">


I think that the way to go is twistd (...)</div></blockquote></div><br><div>That's correct.</div><div><br></div><div>After reading the rest of your message, I don't see any *problems* that you've had with using it.  All the code looks basically right, and you don't mention any tracebacks.</div>


<div><br></div><div>If "just use twistd" doesn't help you, can you explain what exactly doesn't work when you try to use it?</div><span><font color="#888888"><div><br></div><div>-glyph</div>
</font></span></div><br>_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com" target="_blank">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
<br></blockquote></div><br></div>