#1546 closed enhancement (fixed)

pass arbitrary options to twistd through the "tahoe" command-line

Reported by: zooko Owned by:
Priority: normal Milestone: eventually
Component: code-frontend-cli Version: 1.9.0a2
Keywords: cli twisted tahoe-start twistd Cc: warner, meskio@…
Launchpad Bug:

Description (last modified by meskio)

comment:4:ticket:1267 Brian suggested:

What if we accepted a syntax like "tahoe start DIR -- ARG1 ARG2" or "tahoe start -- ARG1 ARG2", and passed all the extra ARG1/ARG2 strings into twistd.run()? I'd really like if it we had a way to pass arbitrary twistd arguments, rather than having to hand-code support for each one.

Change History (9)

comment:1 Changed at 2011-10-03T19:51:32Z by davidsarah

  • Keywords tahoe-start added
  • Milestone changed from undecided to eventually

comment:2 Changed at 2011-10-11T02:50:29Z by davidsarah

  • Keywords twistd added

comment:3 Changed at 2012-03-29T19:27:42Z by davidsarah

  • Priority changed from major to normal

comment:4 Changed at 2013-08-07T13:00:04Z by meskio

  • Description modified (diff)

I'm having a look to this idea so I don't implement by hand the --pidfile for the ticket #2045. What I'm not sure is how to make it consistent with tahoe stop. I think tahoe stop should have a --pidfile option, but I'm not sure how. Maybe something like:

$ tahoe start . -- --pidfile /run/tahoe.pid
$ tahoe stop . --pidfile /run/tahoe.pid

To add '--' to the stop command I think will be confusing, because there is no call after it to twistd to pass the params. But to have it different syntax between start and stop don't looks good.

Any ideas?

comment:5 Changed at 2013-08-07T13:08:12Z by gdt

I think it's a bug for people who use tahoe to have to have any idea that it is built on twisted. That's just an implementation detail which should be changeable.

I'd like to see a configure-time set of switches that set --datadir and the other usual things that autoconf uses, and then for various files to go in the normal places relative to those switches. I'm a little fuzzy on the details but the point is that there are many programs out there which do 95% of what we need.

The one place tahoe is special is in having a huge data directory. But generally programs that do that express it in a configuration file. So perhaps distributions should patch the default file, which can be in ${PREFIX}/share/examples/tahoe/tahoe.cfg. Right now the config file is generated programmatically, which is awkward.

comment:6 Changed at 2013-08-11T13:08:23Z by daira

Knowing that Tahoe nodes are implemented using twistd is actually rather useful for power users; it allows people who know Twisted to understand and tweak its behaviour more easily.

Last edited at 2013-08-11T13:08:33Z by daira (previous) (diff)

comment:7 Changed at 2013-08-25T21:49:15Z by meskio

  • Cc meskio@… added

comment:8 Changed at 2020-01-16T20:14:58Z by exarkun

This was implemented at some point.

$ tahoe run --help
Usage:  tahoe [global-options] run [options] [NODEDIR [twistd-options]]
(use 'tahoe --help' to view global options)

Options:
  -C, --basedir=  Specify which Tahoe base directory should be used. This has
                  the same effect as the global --node-directory option.
                  [default: '/home/exarkun/.tahoe']
      --help      Display this help and exit.
      --version

twistd-options:
  -b, --debug          Run the application in the Python Debugger (implies
                       nodaemon),         sending SIGUSR2 will drop into
                       debugger
      --chroot=        Chroot to a supplied directory before running
  -d, --rundir=        Change to a supplied directory before running [default:
                       .]
  -e, --encrypted      The specified tap/aos file is encrypted.
      --euid           Set only effective user-id rather than real user-id.
                       (This option has no effect unless the server is running
                       as root, in which case it means not to shed all
                       privileges after binding ports, retaining the option to
                       regain privileges in cases such as spawning processes.
                       Use with caution.)
  -f, --file=          read the given .tap file [default: twistd.tap]
  -g, --gid=           The gid to run as.  If not specified, the default gid
                       associated with the specified --uid is used.
      --help           Display this help and exit.
      --help-reactors  Display a list of possibly available reactor names.
  -l, --logfile=       log to a specified file, - for stdout
      --logger=        A fully-qualified name to a log observer factory to use
                       for the initial log observer.  Takes precedence over
                       --logfile and --syslog (when available).
  -n, --nodaemon       don't daemonize, don't use default umask of 0077
  -o, --no_save        do not save state on shutdown
      --originalname   Don't try to change the process name
  -p, --profile=       Run in profile mode, dumping results to specified file.
      --pidfile=       Name of the pidfile [default: twistd.pid]
      --prefix=        use the given prefix when syslogging [default: twisted]
      --profiler=      Name of the profiler to use (profile, cprofile).
                       [default: cprofile]
  -r, --reactor=       Which reactor to use (see --help-reactors for a list of
                       possibilities)
  -s, --source=        Read an application from a .tas file (AOT format).
      --savestats      save the Stats object rather than the text output of the
                       profiler.
      --spew           Print an insanely verbose log of everything that happens.
                       Useful when debugging freezes or locks in complex code.
      --syslog         Log to syslog, not to file
  -u, --uid=           The uid to run as.
      --umask=         The (octal) file creation mask to apply.
      --version        Print version information and exit.
  -y, --python=        read an application from within a Python file (implies
                       -o)

Note that if any twistd-options are used, NODEDIR must be specified explicitly
(not by default or using -C/--basedir or -d/--node-directory), and followed by
the twistd-options.

comment:9 Changed at 2020-01-16T20:15:03Z by exarkun

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.