diff --git a/agent/config/restarter.service b/agent/config/restarter.service index 0e599914e..6b8ee093a 100644 --- a/agent/config/restarter.service +++ b/agent/config/restarter.service @@ -4,4 +4,4 @@ Requires=docker.service [Service] Type=oneshot -ExecStart=/bin/bash /root/restarter.sh \ No newline at end of file +ExecStart=/usr/local/bin/appmgr repair-app-status \ No newline at end of file diff --git a/agent/config/restarter.sh b/agent/config/restarter.sh deleted file mode 100644 index f0045d54a..000000000 --- a/agent/config/restarter.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -exec appmgr repair-app-status \ No newline at end of file diff --git a/agent/src/Lib/Synchronizers.hs b/agent/src/Lib/Synchronizers.hs index d958ff117..8690404d9 100644 --- a/agent/src/Lib/Synchronizers.hs +++ b/agent/src/Lib/Synchronizers.hs @@ -540,17 +540,15 @@ replaceDerivativeCerts = do syncRestarterService :: SyncOp syncRestarterService = SyncOp "Install Restarter Service" check migrate False where - wantedScript = decodeUtf8 $(embedFile "config/restarter.sh") - wantedService = decodeUtf8 $(embedFile "config/restarter.service") - wantedTimer = decodeUtf8 $(embedFile "config/restarter.timer") + wantedService = $(embedFile "config/restarter.service") + wantedTimer = $(embedFile "config/restarter.timer") check = do base <- asks $ appFilesystemBase . appSettings liftIO $ not <$> doesPathExist (toS $ "/etc/systemd/system/timers.target.wants/restarter.timer" `relativeTo` base) migrate = do base <- asks $ appFilesystemBase . appSettings - liftIO $ writeFile (toS $ "/usr/local/bin/restarter.sh" `relativeTo` base) wantedScript - liftIO $ writeFile (toS $ "/etc/systemd/system/restarter.service" `relativeTo` base) wantedService - liftIO $ writeFile (toS $ "/etc/systemd/system/restarter.timer" `relativeTo` base) wantedTimer + 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" failUpdate :: S9Error -> ExceptT Void (ReaderT AgentCtx IO) ()