summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Systemd.hs
diff options
context:
space:
mode:
authorJoey Hess2014-11-21 17:11:26 -0400
committerJoey Hess2014-11-21 17:11:26 -0400
commit6e8b28cd3ce4264927cb9e9475b77954663c2ffa (patch)
treeed00dabb51281d572e9af3b4781fa96f33c620c8 /src/Propellor/Property/Systemd.hs
parent435244353c998c55e1342e375eaec33619ecfe8f (diff)
propellor spin
Diffstat (limited to 'src/Propellor/Property/Systemd.hs')
-rw-r--r--src/Propellor/Property/Systemd.hs25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/Propellor/Property/Systemd.hs b/src/Propellor/Property/Systemd.hs
index d1b6bde6..b50194fa 100644
--- a/src/Propellor/Property/Systemd.hs
+++ b/src/Propellor/Property/Systemd.hs
@@ -1,5 +1,5 @@
module Propellor.Property.Systemd (
- installed,
+ module Propellor.Property.Systemd.Core,
started,
stopped,
enabled,
@@ -14,6 +14,7 @@ import Propellor
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 Utility.SafeCommand
import Utility.FileMode
@@ -30,12 +31,6 @@ instance Hostlike Container where
(Container n c h) &^ p = Container n c (h &^ p)
getHost (Container _ _ h) = h
--- dbus is only a Recommends of systemd, but is needed for communication
--- from the systemd inside a container to the one outside, so make sure it
--- gets installed.
-installed :: Property
-installed = Apt.installed ["systemd", "dbus"]
-
-- | Starts a systemd service.
started :: ServiceName -> Property
started n = trivial $ cmdProperty "systemctl" ["start", n]
@@ -110,20 +105,18 @@ nspawned c@(Container name (Chroot.Chroot loc system builderconf _) h) =
, nspawnService c
]
- -- When provisioning the chroot, pass a version of the Host
- -- that only has the Property of systemd being installed.
- -- This is to avoid starting any daemons in the chroot,
- -- which would not run in the container's namespace.
- chrootprovisioned = Chroot.provisioned' (Chroot.propigateChrootInfo chroot) $
- mkChroot $ h { hostProperties = [installed] }
+ -- 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
-- Use nsenter to enter container and and run propellor to
-- finish provisioning.
containerprovisioned = Chroot.propellChroot chroot
- (enterContainerProcess c)
+ (enterContainerProcess c) False
- mkChroot = Chroot.Chroot loc system builderconf
- chroot = mkChroot h
+ chroot = Chroot.Chroot loc system builderconf h
nspawnService :: Container -> RevertableProperty
nspawnService (Container name _ _) = RevertableProperty setup teardown