From 1da2da7e430cebc176c26d818dec4f9adf216b76 Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Fri, 4 Dec 2020 18:02:06 -0700 Subject: [PATCH] run restarter on startup --- agent/src/Lib/Synchronizers.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/agent/src/Lib/Synchronizers.hs b/agent/src/Lib/Synchronizers.hs index f8db3d5da..27eb691b8 100644 --- a/agent/src/Lib/Synchronizers.hs +++ b/agent/src/Lib/Synchronizers.hs @@ -41,6 +41,7 @@ import System.FilePath.Posix ( takeDirectory ) import System.Directory import System.IO.Error import System.Posix.Files +import System.Process ( callCommand ) import qualified Streaming.Prelude as Stream import qualified Streaming.Conduit as Conduit import qualified Streaming.Zip as Stream @@ -550,7 +551,8 @@ syncRestarterService = SyncOp "Install Restarter Service" check migrate True base <- asks $ appFilesystemBase . appSettings liftIO $ BS.writeFile (toS $ "/etc/systemd/system/restarter.service" `relativeTo` base) wantedService liftIO $ BS.writeFile (toS $ "/etc/systemd/system/restarter.timer" `relativeTo` base) wantedTimer - liftIO . run $ systemctl "enable" "restarter.timer" + liftIO $ callCommand "systemctl enable restarter.service" + liftIO $ callCommand "systemctl enable restarter.timer" failUpdate :: S9Error -> ExceptT Void (ReaderT AgentCtx IO) () failUpdate e = do