ShutdownWaitLength vs. 'restart' in init scripts

Roger Dingledine arma at
Thu Jun 25 08:39:49 UTC 2009

On Tue, Jun 23, 2009 at 12:47:56AM -0400, Bill McGonigle wrote:
> I noticed a problem with the init script I have with the tor package on
> Fedora 10.

Is this with the tor rpm shipped by Fedora? We don't support (or use,
or like, or recommend) the fedora tor rpm.

>  The 'restart' command (just a start and stop) sends a -INT
> to the running process, but doesn't account for ShutdownWaitLength.

Check out how the torctl that we ship in the rpms handles that:
It basically kills it, and then tries to kill it even harder if it
doesn't die. That's probably not the right answer.

The right answer imo is how the deb package does it:
Check out the wait_for_deaddaemon function: it basically checks each
second whether the process is still around, and returns when it's gone
(or 60 seconds have passed).

So I guess if you raise your ShutdownWaitLength, you'll want to tweak
the script. But that still seems better than the
"kill -INT, sleep 1, kill -9" strategy the rpm uses.

Patches to the torctl script greatly appreciated. :)

> or, perhaps even better: fixing the server shutdown process so the old
> server can't take out the new server.

Can you clarify what happens here? 'tor stop' finishes but Tor is still
running, so then 'tor start' fails to launch a new Tor, and then the
old Tor exits, and then you have no Tor running but you think you do?


More information about the tor-talk mailing list