mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
periodically restarts tor daemon when it fails to get a response from itself, rate limits restarts
This commit is contained in:
committed by
Aiden McClelland
parent
5fbf34a84e
commit
ebd74cca3c
@@ -67,6 +67,8 @@ import Model
|
||||
import Settings
|
||||
import Lib.Background
|
||||
import qualified Daemon.SslRenew as SSLRenew
|
||||
import Lib.Tor (newTorManager)
|
||||
import Daemon.TorHealth
|
||||
|
||||
appMain :: IO ()
|
||||
appMain = do
|
||||
@@ -106,6 +108,7 @@ makeFoundation appSettings = do
|
||||
-- subsite.
|
||||
appLogger <- newStdoutLoggerSet defaultBufSize >>= makeYesodLogger
|
||||
appHttpManager <- getGlobalManager
|
||||
appTorManager <- newTorManager (appTorSocksPort appSettings)
|
||||
appWebServerThreadId <- newIORef Nothing
|
||||
appSelfUpdateSpecification <- newEmptyMVar
|
||||
appIsUpdating <- newIORef Nothing
|
||||
@@ -193,6 +196,10 @@ startupSequence foundation = do
|
||||
void . forkIO . forever $ forkIO (SSLRenew.renewSslLeafCert foundation) *> sleep 86_400
|
||||
withAgentVersionLog_ "SSL Renewal daemon started"
|
||||
|
||||
withAgentVersionLog_ "Initializing Tor health check loop"
|
||||
void . forkIO . forever $ forkIO (runReaderT torHealth foundation) *> sleep 300
|
||||
withAgentVersionLog_ "Tor health check loop running"
|
||||
|
||||
-- reloading avahi daemon
|
||||
-- DRAGONS! make sure this step happens AFTER system synchronization
|
||||
withAgentVersionLog_ "Publishing Agent to Avahi Daemon"
|
||||
|
||||
Reference in New Issue
Block a user