@@ -438,6 +438,20 @@ handleSimpleNode blockType runP p2pMode tracers nc onKernel = do
438438 localRootsVar <- newTVarIO localRoots
439439 publicRootsVar <- newTVarIO publicRoots
440440 useLedgerVar <- newTVarIO (useLedgerAfterSlot nt)
441+ #ifdef UNIX
442+ -- initial `SIGHUP` handler, which only rereads the topology file but
443+ -- doesn't update block forging. The latter is only possible once
444+ -- consensus initialised (e.g. reapplied all blocks).
445+ _ <- Signals. installHandler
446+ Signals. sigHUP
447+ (Signals. Catch $ do
448+ updateTopologyConfiguration
449+ (startupTracer tracers) nc
450+ localRootsVar publicRootsVar useLedgerVar
451+ traceWith (startupTracer tracers) (BlockForgingUpdate NotEffective )
452+ )
453+ Nothing
454+ #endif
441455 void $
442456 let diffusionArgumentsExtra =
443457 mkP2PArguments nc
@@ -448,6 +462,7 @@ handleSimpleNode blockType runP p2pMode tracers nc onKernel = do
448462 Node. run
449463 nodeArgs {
450464 rnNodeKernelHook = \ registry nodeKernel -> do
465+ -- reinstall `SIGHUP` handler
451466 installP2PSigHUPHandler (startupTracer tracers) blockType nc nodeKernel
452467 localRootsVar publicRootsVar useLedgerVar
453468 rnNodeKernelHook nodeArgs registry nodeKernel
@@ -481,10 +496,23 @@ handleSimpleNode blockType runP p2pMode tracers nc onKernel = do
481496 | (NodeAddress (NodeHostIPAddress addr) port) <- ipProducerAddrs
482497 ]
483498 (length ipProducerAddrs)
499+ #ifdef UNIX
500+ -- initial `SIGHUP` handler; it only warns that neither updating of
501+ -- topology is supported nor updating block forging is yet possible.
502+ -- It is still useful, without it the node would terminate when
503+ -- receiving `SIGHUP`.
504+ _ <- Signals. installHandler
505+ Signals. sigHUP
506+ (Signals. Catch $ do
507+ traceWith (startupTracer tracers) NetworkConfigUpdateUnsupported
508+ traceWith (startupTracer tracers) (BlockForgingUpdate NotEffective ))
509+ Nothing
510+ #endif
484511 void $
485512 Node. run
486513 nodeArgs {
487514 rnNodeKernelHook = \ registry nodeKernel -> do
515+ -- reinstall `SIGHUP` handler
488516 installNonP2PSigHUPHandler (startupTracer tracers) blockType nc nodeKernel
489517 rnNodeKernelHook nodeArgs registry nodeKernel
490518 }
0 commit comments