File: Signal.hs

package info (click to toggle)
mighttpd2 4.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 212 kB
  • sloc: haskell: 1,287; ansic: 44; makefile: 4
file content (36 lines) | stat: -rw-r--r-- 830 bytes parent folder | download | duplicates (6)
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