Commit fef5c09e authored by Apollon Oikonomopoulos's avatar Apollon Oikonomopoulos Committed by Petr Pudlak

Ganeti.Daemon: always install SIGHUP handler

Install the SIGHUP handler regardless of the daemonization status. This
fixes issue #755.
Signed-off-by: default avatarApollon Oikonomopoulos <>
Signed-off-by: default avatarPetr Pudlak <>
Reviewed-by: default avatarPetr Pudlak <>
parent faa5ce00
......@@ -356,7 +356,6 @@ daemonize logfile action = do
setupDaemonEnv "/" (unionFileModes groupModes otherModes)
setupDaemonFDs (Just logfile) `Control.Exception.catch`
handlePrepErr False wpipe'
_ <- installHandler lostConnection (Catch (handleSigHup logfile)) Nothing
-- second fork, launches the actual child code; standard
-- double-fork technique
_ <- forkProcess (action wpipe')
......@@ -407,6 +406,7 @@ genericMain daemon options check_fn prep_fn exec_fn = do
let processFn = if optDaemonize opts
then daemonize log_file
else \action -> action Nothing
_ <- installHandler lostConnection (Catch (handleSigHup log_file)) Nothing
processFn $ innerMain daemon opts syslog check_result' prep_fn exec_fn
-- | Full prepare function.
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