diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2017-04-13 19:54:00 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2017-04-13 19:54:00 +0200 |
commit | faf009aca16ba1e384fd5da2d6306d1379e36de3 (patch) | |
tree | 69a9183f09b75188b811ddb4eca13727b77f1630 | |
parent | e3227f80fe775acd1bd5bf7ad672bdf687787a6f (diff) | |
download | bar-faf009aca16ba1e384fd5da2d6306d1379e36de3.tar bar-faf009aca16ba1e384fd5da2d6306d1379e36de3.tar.gz bar-faf009aca16ba1e384fd5da2d6306d1379e36de3.tar.bz2 bar-faf009aca16ba1e384fd5da2d6306d1379e36de3.tar.xz bar-faf009aca16ba1e384fd5da2d6306d1379e36de3.zip |
Support systemd.service notify type
-rw-r--r-- | Application.hs | 8 | ||||
-rw-r--r-- | bar.cabal | 3 | ||||
-rw-r--r-- | bar.nix | 12 |
3 files changed, 14 insertions, 9 deletions
diff --git a/Application.hs b/Application.hs index aa9422f..46dc4c1 100644 --- a/Application.hs +++ b/Application.hs | |||
@@ -22,7 +22,8 @@ import Network.Wai (Middleware) | |||
22 | import Network.Wai.Handler.Warp (Settings, defaultSettings, | 22 | import Network.Wai.Handler.Warp (Settings, defaultSettings, |
23 | defaultShouldDisplayException, | 23 | defaultShouldDisplayException, |
24 | runSettings, setHost, | 24 | runSettings, setHost, |
25 | setOnException, setPort, getPort) | 25 | setOnException, setPort, getPort, |
26 | setBeforeMainLoop) | ||
26 | import Network.Wai.Middleware.RequestLogger (Destination (Logger), | 27 | import Network.Wai.Middleware.RequestLogger (Destination (Logger), |
27 | IPAddrSource (..), | 28 | IPAddrSource (..), |
28 | OutputFormat (..), destination, | 29 | OutputFormat (..), destination, |
@@ -45,6 +46,8 @@ import Handler.Types | |||
45 | import Handler.List | 46 | import Handler.List |
46 | import Handler.InventoryList | 47 | import Handler.InventoryList |
47 | 48 | ||
49 | import System.Systemd.Daemon | ||
50 | |||
48 | -- This line actually creates our YesodDispatch instance. It is the second half | 51 | -- This line actually creates our YesodDispatch instance. It is the second half |
49 | -- of the call to mkYesodData which occurs in Foundation.hs. Please see the | 52 | -- of the call to mkYesodData which occurs in Foundation.hs. Please see the |
50 | -- comments there for more details. | 53 | -- comments there for more details. |
@@ -120,7 +123,8 @@ warpSettings foundation = | |||
120 | "yesod" | 123 | "yesod" |
121 | LevelError | 124 | LevelError |
122 | (toLogStr $ "Exception from Warp: " ++ show e)) | 125 | (toLogStr $ "Exception from Warp: " ++ show e)) |
123 | defaultSettings | 126 | $ setBeforeMainLoop (void notifyReady) |
127 | $ defaultSettings | ||
124 | 128 | ||
125 | -- | For yesod devel, return the Warp settings and WAI Application. | 129 | -- | For yesod devel, return the Warp settings and WAI Application. |
126 | getApplicationDev :: IO (Settings, Application) | 130 | getApplicationDev :: IO (Settings, Application) |
@@ -1,5 +1,5 @@ | |||
1 | name: bar | 1 | name: bar |
2 | version: 0.4.1 | 2 | version: 0.4.2 |
3 | cabal-version: >= 1.8 | 3 | cabal-version: >= 1.8 |
4 | build-type: Simple | 4 | build-type: Simple |
5 | 5 | ||
@@ -108,6 +108,7 @@ library | |||
108 | , lens | 108 | , lens |
109 | , thermoprint-client | 109 | , thermoprint-client |
110 | , hashids | 110 | , hashids |
111 | , systemd | ||
111 | 112 | ||
112 | executable bar | 113 | executable bar |
113 | if flag(library-only) | 114 | if flag(library-only) |
@@ -3,14 +3,14 @@ | |||
3 | , conduit, containers, data-default, directory, fast-logger | 3 | , conduit, containers, data-default, directory, fast-logger |
4 | , file-embed, hashids, hjsmin, http-conduit, lens, monad-control | 4 | , file-embed, hashids, hjsmin, http-conduit, lens, monad-control |
5 | , monad-logger, mtl, persistent, persistent-postgresql | 5 | , monad-logger, mtl, persistent, persistent-postgresql |
6 | , persistent-template, safe, shakespeare, stdenv, template-haskell | 6 | , persistent-template, safe, shakespeare, stdenv, systemd |
7 | , text, thermoprint-client, time, unordered-containers, vector, wai | 7 | , template-haskell, text, thermoprint-client, time |
8 | , wai-extra, wai-logger, warp, yaml, yesod, yesod-auth, yesod-core | 8 | , unordered-containers, vector, wai, wai-extra, wai-logger, warp |
9 | , yesod-form, yesod-static | 9 | , yaml, yesod, yesod-auth, yesod-core, yesod-form, yesod-static |
10 | }: | 10 | }: |
11 | mkDerivation { | 11 | mkDerivation { |
12 | pname = "bar"; | 12 | pname = "bar"; |
13 | version = "0.4.1"; | 13 | version = "0.4.2"; |
14 | src = ./.; | 14 | src = ./.; |
15 | isLibrary = true; | 15 | isLibrary = true; |
16 | isExecutable = true; | 16 | isExecutable = true; |
@@ -19,7 +19,7 @@ mkDerivation { | |||
19 | classy-prelude-conduit classy-prelude-yesod conduit containers | 19 | classy-prelude-conduit classy-prelude-yesod conduit containers |
20 | data-default directory fast-logger file-embed hashids hjsmin | 20 | data-default directory fast-logger file-embed hashids hjsmin |
21 | http-conduit lens monad-control monad-logger mtl persistent | 21 | http-conduit lens monad-control monad-logger mtl persistent |
22 | persistent-postgresql persistent-template safe shakespeare | 22 | persistent-postgresql persistent-template safe shakespeare systemd |
23 | template-haskell text thermoprint-client time unordered-containers | 23 | template-haskell text thermoprint-client time unordered-containers |
24 | vector wai wai-extra wai-logger warp yaml yesod yesod-auth | 24 | vector wai wai-extra wai-logger warp yaml yesod yesod-auth |
25 | yesod-core yesod-form yesod-static | 25 | yesod-core yesod-form yesod-static |