From 6a5a1bc76132128e4bd2312dfadc98e83b0baf40 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 21 Nov 2014 12:17:03 -0400 Subject: systemd container may be mostly done (untested) --- src/Propellor/Property/Chroot.hs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/Propellor/Property/Chroot.hs') 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 -- cgit v1.3-2-g0d8e