Instead of constructing a sys.argv for 'twistd' that reads the node's .tac file, we construct arguments that tell twistd to use a special in-memory-only plugin that creates the desired node instance directly. We still use the name of the .tac file to decide which kind of instance to make (Client, IntroducerNode, KeyGenerator, StatsGatherer), but never actually read the contents of the .tac file. Later improvements could change this to look inside the tahoe.cfg for a nodetype= directive, etc. This also makes it easy to have "tahoe start BASEDIR" pass the rest of its arguments on to twistd, so e.g. "tahoe start BASEDIR --nodaemon --profile=prof.out" does what you'd expect "twistd --nodaemon --profile=prof.out" to do. "tahoe run BASEDIR" is thus simply aliased to "tahoe start BASEDIR --nodaemon". This removes the need to special-case --profile and --syslog. I also removed some of the default logging behavior: before: 'tahoe start' = 'twistd --logfile BASEDIR logs/twistd.log' 'tahoe start --profile' adds '--profile=profiling_results.prof --savestats' 'tahoe run' = 'twistd --nodaemon --logfile BASEDIR/logs/tahoesvc.log' after: 'tahoe start' = 'twistd --logfile BASEDIR logs/twistd.log' unless --logfile, --nodaemon, or --syslog are passed 'tahoe start --profile' invalid, use 'tahoe start --profile=OUTPUT' 'tahoe run' = 'twistd --nodaemon' so log messages go to stdout This finally enables 'tahoe run' to work with all node types, including the key-generator and stats-gatherer. It gets 'tahoe start' one step closer to accepting --reactor= . To actually accomplish this will require this file, the enclosing __init_.py files, and everything they import to avoid importing the reactor. (if anything imports twisted.internet.reactor before startstop_node.start() gets to run, then --reactor= comes too late). That will take a lot of work, and requires lazy-loading of many core libraries (foolscap.logging in particular), and removing a lot of code from src/allmydata/__init__.py .
Tahoe-LAFS
Tahoe-LAFS is a Free Software/Open Source decentralized data store. It distributes your filesystem across multiple servers, and even if some of the servers fail or are taken over by an attacker, the entire filesystem continues to work correctly and to preserve your privacy and security.
To get started please see quickstart.rst in the docs directory.
LICENCE
Copyright 2006-2014 The Tahoe-LAFS Software Foundation
You may use this package under the GNU General Public License, version 2 or, at your option, any later version. You may use this package under the Transitive Grace Period Public Licence, version 1.0, or at your option, any later version. (You may choose to use this package under the terms of either licence, at your option.) See the file COPYING.GPL for the terms of the GNU General Public License, version 2. See the file COPYING.TGPPL.rst for the terms of the Transitive Grace Period Public Licence, version 1.0.
See TGPPL.PDF for why the TGPPL exists, graphically illustrated on three slides.