Commit 4cfa01f4 authored by Petr Pudlak's avatar Petr Pudlak
Browse files

When starting the Luxi daemon, check if it's able to fork

If a Haskell program is compiled with -threaded, then inheriting open
file descriptors doesn't work, which breaks our job death detection
mechanism. (And on older GHC versions even forking doesn't work.)

Therefore let Luxi daemon check and let it fail to start, if it detect
it has been compiled with -threaded.
Signed-off-by: default avatarPetr Pudlak <>
Reviewed-by: default avatarKlaus Aehlig <>
parent d182955c
......@@ -63,11 +63,13 @@ import qualified Ganeti.Query.Cluster as QCluster
import Ganeti.Path ( queueDir, jobQueueLockFile, jobQueueDrainFile
, defaultMasterSocket)
import Ganeti.Rpc
import qualified Ganeti.Query.Exec as Exec
import Ganeti.Query.Query
import Ganeti.Query.Filter (makeSimpleFilter)
import Ganeti.Types
import qualified Ganeti.UDSServer as U (Handler(..), listener)
import Ganeti.Utils (lockFile, exitIfBad, watchFile, safeRenameFile)
import Ganeti.Utils ( lockFile, exitIfBad, exitUnless, watchFile
, safeRenameFile )
import qualified Ganeti.Version as Version
-- | Helper for classic queries.
......@@ -442,6 +444,9 @@ checkMain _ = return $ Right ()
-- | Prepare function for luxid.
prepMain :: PrepFn () PrepResult
prepMain _ _ = do
>>= flip exitUnless "The daemon must be compiled without -threaded"
socket_path <- Path.defaultQuerySocket
cleanupSocket socket_path
s <- describeError "binding to the Luxi socket"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment