summaryrefslogtreecommitdiff
path: root/Propellor
diff options
context:
space:
mode:
authorJoey Hess2014-05-11 10:30:45 -0300
committerJoey Hess2014-05-11 10:30:45 -0300
commit1f573876b76184f0d5dd24e13df9d894a6b3a29f (patch)
treeef176e605c32dd7b838b62a89f0414d4b989fc3f /Propellor
parent782e4f7f4bb738c309a83a0931d75ba983069eb7 (diff)
propellor spin
Diffstat (limited to 'Propellor')
-rw-r--r--Propellor/SimpleSh.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Propellor/SimpleSh.hs b/Propellor/SimpleSh.hs
index f1a84951..99dd3cc6 100644
--- a/Propellor/SimpleSh.hs
+++ b/Propellor/SimpleSh.hs
@@ -6,6 +6,7 @@
module Propellor.SimpleSh where
import Network.Socket
+import Control.Concurrent
import Control.Concurrent.Chan
import Control.Concurrent.Async
import System.Process (std_in, std_out, std_err)
@@ -31,8 +32,9 @@ simpleSh namedpipe = do
listen s 2
forever $ do
(client, _addr) <- accept s
- h <- socketToHandle client ReadWriteMode
- maybe noop (run h) . readish =<< hGetLine h
+ forkIO $ do
+ h <- socketToHandle client ReadWriteMode
+ maybe noop (run h) . readish =<< hGetLine h
where
run h (Cmd cmd params) = do
debug ["simplesh run", cmd, show params]