summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Systemd.hs
diff options
context:
space:
mode:
authorJoey Hess2014-11-21 13:49:17 -0400
committerJoey Hess2014-11-21 13:49:17 -0400
commit3ba82a1c9c27f1e79eeecfcfad7bbb9dce653488 (patch)
tree7a7e8bf021c07d6e199bd6e47ceb7a4528a09305 /src/Propellor/Property/Systemd.hs
parentb076b1b3d3f0f60ad9ab42bce12c1b3a8baef4b6 (diff)
propellor spin
Diffstat (limited to 'src/Propellor/Property/Systemd.hs')
-rw-r--r--src/Propellor/Property/Systemd.hs22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/Propellor/Property/Systemd.hs b/src/Propellor/Property/Systemd.hs
index 3f2dccca..3547f604 100644
--- a/src/Propellor/Property/Systemd.hs
+++ b/src/Propellor/Property/Systemd.hs
@@ -88,14 +88,14 @@ container name system ps = Container name system ps (Host name [] mempty)
nspawned :: Container -> RevertableProperty
nspawned c@(Container name system _ h) = RevertableProperty setup teardown
where
- setup = containerprovisioned
- `requires` toProp (nspawnService c)
- `requires` toProp chrootprovisioned
- `requires` toProp (enterScript c)
-
- teardown = toProp (revert (chrootprovisioned))
- `requires` toProp (revert (nspawnService c))
- `requires` toProp (revert (enterScript c))
+ setup = propertyList ("nspawned " ++ name) (map toProp steps)
+ teardown = propertyList ("not nspawned " ++ name)
+ (map (toProp . revert) (reverse steps))
+ steps =
+ [ enterScript c
+ , chrootprovisioned
+ , nspawnService c
+ ]
-- When provisioning the chroot, pass a version of the Host
-- that only has the Property of systemd being installed.
@@ -119,10 +119,8 @@ nspawnService (Container name _ ps _) = RevertableProperty setup teardown
servicefile = "/etc/systemd/system/multi-user.target.wants" </> service
setup = check (not <$> doesFileExist servicefile) $
- combineProperties ("container running " ++ service)
- [ enabled service
- , started service
- ]
+ started service
+ `requires` enabled service
-- TODO ^ adjust execStart line to reflect ps
teardown = undefined