File: Signal.hs

package info (click to toggle)
mighttpd2 4.0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 192 kB
  • sloc: haskell: 1,382; makefile: 4; sh: 3
file content (37 lines) | stat: -rw-r--r-- 834 bytes parent folder | download
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
37
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