From 402f25ccc5de844b2a93a46afc3385a754d3935a Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 22 Oct 2023 13:09:20 +0200 Subject: [PATCH] cluster/services/idm: fix stdout buffering for idm-nss-ready --- cluster/services/idm/modules/idm-nss-ready.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cluster/services/idm/modules/idm-nss-ready.nix b/cluster/services/idm/modules/idm-nss-ready.nix index f6b11b7..9b28a2f 100644 --- a/cluster/services/idm/modules/idm-nss-ready.nix +++ b/cluster/services/idm/modules/idm-nss-ready.nix @@ -6,13 +6,20 @@ let } '' import Control.Monad.IO.Class import Control.Watchdog + import System.IO import System.IO.Error import System.Posix.User + flushLogger :: WatchdogLogger String + flushLogger taskErr delay = do + defaultLogger taskErr delay + hFlush stdout + main :: IO () main = watchdog $ do setInitialDelay 300_000 setMaximumDelay 30_000_000 + setLoggingAction flushLogger watch $ do check <- liftIO $ tryIOError $ getGroupEntryForName "infra_admins" case check of