summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2017-04-13 19:54:00 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2017-04-13 19:54:00 +0200
commitfaf009aca16ba1e384fd5da2d6306d1379e36de3 (patch)
tree69a9183f09b75188b811ddb4eca13727b77f1630
parente3227f80fe775acd1bd5bf7ad672bdf687787a6f (diff)
downloadbar-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.hs8
-rw-r--r--bar.cabal3
-rw-r--r--bar.nix12
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)
22import Network.Wai.Handler.Warp (Settings, defaultSettings, 22import 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)
26import Network.Wai.Middleware.RequestLogger (Destination (Logger), 27import Network.Wai.Middleware.RequestLogger (Destination (Logger),
27 IPAddrSource (..), 28 IPAddrSource (..),
28 OutputFormat (..), destination, 29 OutputFormat (..), destination,
@@ -45,6 +46,8 @@ import Handler.Types
45import Handler.List 46import Handler.List
46import Handler.InventoryList 47import Handler.InventoryList
47 48
49import 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.
126getApplicationDev :: IO (Settings, Application) 130getApplicationDev :: IO (Settings, Application)
diff --git a/bar.cabal b/bar.cabal
index ffeb4be..c88457e 100644
--- a/bar.cabal
+++ b/bar.cabal
@@ -1,5 +1,5 @@
1name: bar 1name: bar
2version: 0.4.1 2version: 0.4.2
3cabal-version: >= 1.8 3cabal-version: >= 1.8
4build-type: Simple 4build-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
112executable bar 113executable bar
113 if flag(library-only) 114 if flag(library-only)
diff --git a/bar.nix b/bar.nix
index 53bbb10..1180260 100644
--- a/bar.nix
+++ b/bar.nix
@@ -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}:
11mkDerivation { 11mkDerivation {
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