diff options
| author | Joey Hess <joey@kitenet.net> | 2014-11-21 12:17:03 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-11-21 12:17:03 -0400 |
| commit | 6a5a1bc76132128e4bd2312dfadc98e83b0baf40 (patch) | |
| tree | 712f9edaf6833bc3c9df41405ce9fe9810c754ee /src/Propellor/Property/Chroot.hs | |
| parent | 1af298dc10fddc3deb32fa8af2638d00dfbc2665 (diff) | |
systemd container may be mostly done (untested)
Diffstat (limited to 'src/Propellor/Property/Chroot.hs')
| -rw-r--r-- | src/Propellor/Property/Chroot.hs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs index 874d7750..e7bac84a 100644 --- a/src/Propellor/Property/Chroot.hs +++ b/src/Propellor/Property/Chroot.hs @@ -2,6 +2,8 @@ module Propellor.Property.Chroot ( Chroot(..), chroot, provisioned, + -- * Internal use + propellChroot, chain, ) where @@ -42,7 +44,7 @@ provisioned c@(Chroot loc system _) = RevertableProperty where go desc a = property (chrootDesc c desc) $ ensureProperties [a] - setup = provisionChroot c `requires` toProp built + setup = propellChroot c (inChrootProcess c) `requires` toProp built built = case system of (System (Debian _) _) -> debootstrap @@ -60,11 +62,8 @@ chrootInfo (Chroot loc _ h) = mempty { _chrootinfo = mempty { _chroots = M.singleton loc h } } -- | Propellor is run inside the chroot to provision it. --- --- Strange and wonderful tricks let the host's /usr/local/propellor --- be used inside the chroot, without needing to install anything. -provisionChroot :: Chroot -> Property -provisionChroot c@(Chroot loc _ _) = property (chrootDesc c "provisioned") $ do +propellChroot :: Chroot -> ([String] -> CreateProcess) -> Property +propellChroot c@(Chroot loc _ _) mkproc = property (chrootDesc c "provisioned") $ do let d = localdir </> shimdir c let me = localdir </> "propellor" shim <- liftIO $ ifM (doesDirectoryExist d) @@ -90,7 +89,7 @@ provisionChroot c@(Chroot loc _ _) = property (chrootDesc c "provisioned") $ do chainprovision shim = do parenthost <- asks hostName cmd <- liftIO $ toChain parenthost c - let p = inChrootProcess c + let p = mkproc [ shim , "--continue" , show cmd |
