1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
module Program.Mighty.Signal (
-- * Signals
sigStop
, sigReload
, sigRetire
, sigInfo
-- * Signal handling
, setHandler
) where
import Control.Monad
import System.Posix
----------------------------------------------------------------
-- | The signal to stop Mighty.
sigStop :: Signal
sigStop = sigTERM
-- | The signal to reload a configration file.
sigReload :: Signal
sigReload = sigHUP
-- | The signal to top accepting new connections and to finish current connections.
sigRetire :: Signal
sigRetire = sigQUIT
-- | The signal to get information from Mighty.
sigInfo :: Signal
sigInfo = sigUSR2
----------------------------------------------------------------
-- | Setting 'Handler' for 'Signal'.
setHandler :: Signal -> Handler -> IO ()
setHandler sig func = void $ installHandler sig func Nothing
|