Re: [tor-relays] Tor automatic restart

2021-10-11 Thread Tor Manager
On Sunday, October 10, 2021 at 4:48:47 AM UTC-4 Keifer Bly wrote:

> I am wondering, is there a way configure tor (via the torrc file) to 
> restart automatically once a month? Thank you.
>

Before you implement a time-based service restart, you may wish to check 
that your OS and hardware (eg. firmware) are as up to date as you can 
reasonably make them. It strikes me as odd that you would have that 
instability that would require such a service restart. Do you have other 
services running? Are you running any sort of system monitoring that would 
tell you about issues with RAM or persistent storage?

With that said, I have used monit[0] in the past to bring services back up 
when a test fails, though never tor. Note that my go-to if I were going to 
implement monit would be to have a service check, and not restart on a time 
basis, but rather on a threshold or reachability basis. Eg. if you were 
going to use monit with a webapp, Id suggest you have a page in the style 
of https://example.org/webapp/monit-check/ that must load the app runtime, 
and then have monit restart everything involved in the app if that page 
load takes more than 15 seconds. In your case that might look like 
installing nyx[1] and having a wrapper script that checks with nyx and has 
a non-zero exit you can have monit act on.

Cheers,
--
ibiblio Tor Manager

[0] https://mmonit.com/monit/documentation/monit.html
[1] https://nyx.torproject.org/

___
tor-relays mailing list
tor-relays@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays


Re: [tor-relays] Restarting Tor

2021-10-11 Thread Tor Manager
Greetings! Thanks for running your relays!

On Sunday, October 10, 2021 at 4:49:16 AM UTC-4 sysmanager7 via tor-relays 
wrote:

> Greetings All, I have three relays that are in need of an upgrade and 
> reboot.
> What is the best way to restart these relays without loosing flags or time?
>

We routinely reboot our nodes for kernel updates and retain the stable 
flag. High uptime is not something to brag about for a tor node, so don't 
worry about that.

If you're running a debian-based linux distro, you can have 
unattended-upgrades[0] do the work for you and warn you via email. There 
are tools that will allow for similar workflows for other OSes, eg. with 
dnf on rpm-based distros[1].

 

> Secondly how long can a relay be down before flags are dropped?
>

I don't know the upper bound, but twice I've migrated keys from an old 
piece of hardware to a new piece of hardware when the support warranty 
expired, and that node still has the stable flag. I took my time and did 
the migration carefully. It's far more important that you follow the 
advice[2] on how to keep your relay in good shape once it's up and running 
than that you find the limits of certain flags.

Cheers!
--
ibiblio Tor Manager

[0] https://wiki.debian.org/UnattendedUpgrades
[1] https://dnf.readthedocs.io/en/latest/automatic.html
[2] https://community.torproject.org/relay/setup/post-install/
___
tor-relays mailing list
tor-relays@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays