From 4a0f3076a6f3269409e7bf33120b0cc9cfa65630 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 9 Apr 2017 17:23:53 -0400 Subject: propellor spin --- src/Propellor/Property/Bootstrap.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Propellor/Property/Bootstrap.hs') diff --git a/src/Propellor/Property/Bootstrap.hs b/src/Propellor/Property/Bootstrap.hs index fa240782..7fd9595b 100644 --- a/src/Propellor/Property/Bootstrap.hs +++ b/src/Propellor/Property/Bootstrap.hs @@ -5,6 +5,7 @@ import Propellor.Bootstrap import Propellor.Property.Chroot import Data.List +import System.Posix.Directory -- | Where a propellor repository should be bootstrapped from. data RepoSource @@ -97,6 +98,12 @@ exposeTrueLocaldir a = ifM inChroot -- Have to lazy unmount, because the propellor process -- is running in the localdir that it's unmounting.. run "umount" [Param "-l", File from] + -- We were in the old localdir; move to the new one after + -- flipping the bind mounts. Otherwise, commands that try + -- to access the cwd will fail because it got umounted out + -- from under. + changeWorkingDirectory "/" + changeWorkingDirectory localdir run cmd ps = unlessM (boolSystem cmd ps) $ error $ "exposeTrueLocaldir failed to run " ++ show (cmd, ps) -- cgit v1.2.3