pub enum Signal {
Show 15 variants
Reload,
Hup,
Shutdown,
Int,
Dump,
Usr1,
Debug,
Usr2,
Halt,
Term,
Newnym,
ClearDnsCache,
Heartbeat,
Active,
Dormant,
}Expand description
Signals that can be sent to the Tor process.
These signals control Tor’s behavior and can be sent via
controller::Controller::signal.
§Signal Pairs
Some signals have Unix signal equivalents:
Reload/Hup- Reload configuration (SIGHUP)Shutdown/Int- Graceful shutdown (SIGINT)Dump/Usr1- Dump stats (SIGUSR1)Debug/Usr2- Debug logging (SIGUSR2)Halt/Term- Immediate exit (SIGTERM)
§Example
use stem_rs::{controller::Controller, Signal};
// Request new circuits for privacy
controller.signal(Signal::Newnym).await?;
// Clear DNS cache
controller.signal(Signal::ClearDnsCache).await?;Variants§
Reload
Reload configuration files.
Tor will reload torrc and apply changes that can be changed at runtime. Equivalent to sending SIGHUP.
Hup
Alias for Reload.
Unix SIGHUP signal equivalent.
Shutdown
Controlled shutdown.
Tor will close listeners and exit cleanly after current connections complete, waiting ShutdownWaitLength if configured as a relay.
Int
Alias for Shutdown.
Unix SIGINT signal equivalent.
Dump
Dump information about open connections and circuits to the log.
Useful for debugging connection issues.
Usr1
Alias for Dump.
Unix SIGUSR1 signal equivalent.
Debug
Switch logging to DEBUG level.
Temporarily enables debug-level logging until the next RELOAD.
Usr2
Alias for Debug.
Unix SIGUSR2 signal equivalent.
Halt
Immediate shutdown.
Tor exits immediately without waiting for connections to close.
Term
Alias for Halt.
Unix SIGTERM signal equivalent.
Newnym
Request new circuits for future connections.
Clears the current circuit cache and builds new circuits. Also clears the DNS cache. Rate-limited to prevent abuse. Use this for privacy when you want to appear as a “new” user.
ClearDnsCache
Clear cached DNS results.
Forces Tor to re-resolve all hostnames on subsequent requests.
Heartbeat
Trigger a heartbeat log message.
Useful for monitoring that Tor is responsive.
Active
Wake from dormant mode.
Resumes normal operation if Tor was in dormant mode. Disables dormant mode.
Dormant
Enter dormant mode.
Reduces resource usage (CPU and network) when Tor is not actively needed. Tor will avoid building circuits and making network connections.