<html><body>On 01:34 pm, exarkun@divmod.com wrote:<br />>On Mon, 09 Apr 2007 15:21:50 +0200, Roland Hedberg <br />><roland.hedberg@adm.umu.se> wrote:<br /><br />>>Is there anyway by which I can tell mktap to "forget" about the<br />>>sleepycat database or ... ?<br /><br />>Two possibilities jump out at me:<br />><br />>  - Don't invoke the initialization code of that package in makeService,<br />>    wait until the startService method of the service you create is called,<br />>    and invoke it then.  This will prevent the DB from being opened until<br />>    the application is actually started (ie, when twistd is run).<br /><br />This has the added advantage of working with the --uid and --gid options of twistd as well.  If your objects are created as the service is created, they will be created (and the database opened) as root.  You almost always want to wait until the service actually starts up, i.e. until Twisted has already daemonized, already shed privileges, to actually open files and databases.<br /><br />>  - Don't use mktap, just use twistd<br /><br />There is also probably no reason to use mktap for a case like this any more though, and there are no tests to ensure that pickles remain compatible across Twisted or Python versions.  Not only are there no automated tests, but as far as I know nobody is still using taps as a method persisting configuration any more, so it is unlikely there is any mechanism for us to notice if pickle compatibility is broken.<br /><br />In other words, you're probably better off taking both of JP's suggestions rather than just one.</body></html>