propellor spin

This commit is contained in:
Joey Hess 2014-04-04 18:46:54 -04:00
parent 66058fdabf
commit ddfee66915
Failed to extract signature
1 changed files with 4 additions and 4 deletions

View File

@ -295,22 +295,22 @@ chain s = case toContainerId s of
Just cid -> do Just cid -> do
changeWorkingDirectory localdir changeWorkingDirectory localdir
writeFile propellorIdent . show =<< readIdentFile cid writeFile propellorIdent . show =<< readIdentFile cid
gogo reapzombies
-- Run boot provisioning before starting simpleSh, -- Run boot provisioning before starting simpleSh,
-- to avoid ever provisioning twice at the same time. -- to avoid ever provisioning twice at the same time.
whenM (checkProvisionedFlag cid) $ do whenM (checkProvisionedFlag cid) $ do
let shim = Shim.file (localdir </> "propellor") (localdir </> shimdir cid) let shim = Shim.file (localdir </> "propellor") (localdir </> shimdir cid)
unlessM (boolSystem shim [Param "--continue", Param $ show $ Chain $ fromContainerId cid]) $ unlessM (boolSystem shim [Param "--continue", Param $ show $ Chain $ fromContainerId cid]) $
warningMessage "Boot provision failed!" warningMessage "Boot provision failed!"
gogo $ simpleSh $ namedPipe cid void $ async $ job reapzombies
forever $ do void $ async $ job $ simpleSh $ namedPipe cid
job $ do
void $ ifM (inPath "bash") void $ ifM (inPath "bash")
( boolSystem "bash" [Param "-l"] ( boolSystem "bash" [Param "-l"]
, boolSystem "/bin/sh" [] , boolSystem "/bin/sh" []
) )
putStrLn "Container is still running. Press ^P^Q to detach." putStrLn "Container is still running. Press ^P^Q to detach."
where where
gogo = void . async . forever . void . tryIO job = forever . void . tryIO
reapzombies = void $ getAnyProcessStatus True False reapzombies = void $ getAnyProcessStatus True False
-- | Once a container is running, propellor can be run inside -- | Once a container is running, propellor can be run inside