summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoey Hess2015-06-01 17:00:57 -0400
committerJoey Hess2015-06-01 17:00:57 -0400
commit06ebb4593acb0ae70e9413ee63df41eb250adb92 (patch)
tree244da46458949662009621954f4f56bb2b94d236 /src
parent4a8ca90d65181bf50a01cfe93dfba2f176ae9f13 (diff)
propellor spin
Diffstat (limited to 'src')
-rw-r--r--src/Propellor/Property/Systemd.hs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/Propellor/Property/Systemd.hs b/src/Propellor/Property/Systemd.hs
index c2446b2e..ea8c994e 100644
--- a/src/Propellor/Property/Systemd.hs
+++ b/src/Propellor/Property/Systemd.hs
@@ -38,6 +38,7 @@ import qualified Propellor.Property.Chroot as Chroot
import qualified Propellor.Property.Apt as Apt
import qualified Propellor.Property.File as File
import Propellor.Property.Systemd.Core
+import Propellor.Property.Mount
import Utility.FileMode
import Data.List
@@ -165,8 +166,19 @@ nspawned c@(Container name (Chroot.Chroot loc system builderconf _) h) =
-- Chroot provisioning is run in systemd-only mode,
-- which sets up the chroot and ensures systemd and dbus are
-- installed, but does not handle the other provisions.
- chrootprovisioned = Chroot.provisioned'
- (Chroot.propigateChrootInfo chroot) chroot True
+ chrootprovisioned =
+ (toProp provisioner `onChange` umountProc)
+ <!>
+ (toProp (revert provisioner))
+ provisioner = Chroot.provisioned' (Chroot.propigateChrootInfo chroot) chroot True
+
+ -- The chroot's /proc is left mounted by the chroot provisioning,
+ -- but that will prevent systemd-nspawn from starting systemd in
+ -- it, so unmount.
+ umountProc = check (elem procloc <$> mountPointsBelow loc) $
+ property (procloc ++ " unmounted") $ do
+ makeChange $ umountLazy procloc
+ procloc = loc </> "proc"
-- Use nsenter to enter container and and run propellor to
-- finish provisioning.