TWISTD(1)

πŸ“¦ version 25.5.0, in alpine 3.24, epel 10, epel 9, fedora 43, fedora 44

πŸ’– TWISTD(1) πŸ’–

✨ NAME ✨

okay so the manual name is twistd, and it's all about running Twisted applications (TACs, TAPs) πŸ¦‹

🌸 SYNOPSIS 🌸

twistd [options]

🧚 DESCRIPTION 🧚

okay so twistd literally reads a twisted.application.service.Application out of a file and then runs it for you πŸ’… no cap, that's the whole job bestie ✨

πŸŽ€ OPTIONS πŸŽ€

  • -n, --nodaemon β€” don't daemonize, just stay in the foreground 🌈
  • -q, --quiet β€” this one does nothing at all, it's only here for backwards compatibility πŸ™ˆ
  • -p, --profile <profile output> β€” runs the app under the profiler and dumps the results into the file you name πŸ“Š
  • --profiler <profiler name> β€” picks which profiler to use. it defaults to the hotshot profiler πŸ”₯
  • --savestats β€” saves the Stats object instead of the plain text output from the profiler πŸ’œ
  • -b, --debug β€” runs the app in the Python Debugger (this implies --nodaemon). send a SIGINT or SIGUSR2 signal to the process and it drops right into the debugger πŸ›
  • -e, --encrypted <file> β€” tells twistd the tap/aos file you gave it is encrypted πŸ”
  • --euid β€” sets only the effective user-id, not the real one. this does nothing unless the server is running as root. if it is, it means don't shed all your privileges after binding ports, so you can still get them back later for stuff like spawning processes.
⚠️ bestie, use this with caution! 😭
  • -o, --no_save β€” don't save shutdown state 🫢
  • --originalname β€” acts like the specified Application has no process name set, and runs with the standard one (usually the Python binary) 🧸
  • -l, --logfile <logfile> β€” logs to the file you pick, or - for stdout. the default is twistd.log. the log file gets rotated on SIGUSR1 πŸ“
  • -l, --logger <fully qualified python name> β€” a fully-qualified name for a log observer factory to use as the initial log observer. this one wins over --logfile and --syslog πŸ‘‘
  • --pidfile <pidfile> β€” saves the pid in the file you name. default is twistd.pid πŸ“
  • --chroot <directory> β€” chroots into the directory you give before running. by default it doesn't chroot at all. the chroot happens before the current directory gets changed 🌳
  • -d, --rundir <directory> β€” changes into the directory you give before running. default is . πŸ“‚
  • -u, --uid <uid> β€” the uid to run as. default is don't change it πŸͺͺ
  • -g, --gid <gid> β€” the gid to run as. default is don't change it πŸͺͺ
  • --umask <mask> β€” the (octal) file creation mask to apply. the default is 0077 for daemons and no change otherwise πŸŒ™
  • -r, --reactor <reactor> β€” picks which reactor to use. check --help-reactors for the list of options 🌊
  • --help-reactors β€” lists the names of the reactors that might be available πŸ¦‹
  • --spew β€” writes an extremely verbose log of everything that happens. super useful for debugging freezes or locks in complicated code πŸ•΅οΈβ€β™€οΈ
  • -f, --file <tap file> β€” reads the given .tap file. default is twistd.tap 🎁
  • -s, --source <tas file> β€” loads an Application from the given .tas (AOT Python source) file 🐍
  • -y, --python <python file> β€” uses the variable "application" from the Python file you give. this overrides -f and implies --no_save πŸ’…
  • --syslog β€” logs to syslog instead of a file πŸ“œ
  • --version β€” prints the version info and exits 🏷️
  • --prefix <prefix> β€” uses the prefix you pick when logging to the logfile. default is "twisted" πŸ’–

Note that if twistd is run as root, the working directory is not searched for Python modules. πŸ™ˆ

πŸ¦‹ SIGNALS πŸ¦‹

a running twistd accepts SIGINT for a clean shutdown, and SIGUSR1 to rotate the log files 🌸

πŸ‘‘ AUTHOR πŸ‘‘

written by Moshe Zadka, based on twistd's help messages 🫢

πŸ› REPORTING BUGS πŸ›

to report a bug, visit http://twistedmatrix.com/trac/wiki/TwistedDevelopment#DevelopmentProcess πŸ’Œ

Copyright © 2001-2011 Twisted Matrix Laboratories. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ✨


bye bestie, that's the whole twistd manual πŸ’– it's Twisted Matrix Laboratories' work, dated Dec 2011, and I'm obsessed with you for reading it all the way through πŸ«ΆπŸ’…βœ¨

πŸ“¦ where this page comes from