propellor spin
This commit is contained in:
parent
b076b1b3d3
commit
3ba82a1c9c
|
@ -88,14 +88,14 @@ container name system ps = Container name system ps (Host name [] mempty)
|
||||||
nspawned :: Container -> RevertableProperty
|
nspawned :: Container -> RevertableProperty
|
||||||
nspawned c@(Container name system _ h) = RevertableProperty setup teardown
|
nspawned c@(Container name system _ h) = RevertableProperty setup teardown
|
||||||
where
|
where
|
||||||
setup = containerprovisioned
|
setup = propertyList ("nspawned " ++ name) (map toProp steps)
|
||||||
`requires` toProp (nspawnService c)
|
teardown = propertyList ("not nspawned " ++ name)
|
||||||
`requires` toProp chrootprovisioned
|
(map (toProp . revert) (reverse steps))
|
||||||
`requires` toProp (enterScript c)
|
steps =
|
||||||
|
[ enterScript c
|
||||||
teardown = toProp (revert (chrootprovisioned))
|
, chrootprovisioned
|
||||||
`requires` toProp (revert (nspawnService c))
|
, nspawnService c
|
||||||
`requires` toProp (revert (enterScript c))
|
]
|
||||||
|
|
||||||
-- When provisioning the chroot, pass a version of the Host
|
-- When provisioning the chroot, pass a version of the Host
|
||||||
-- that only has the Property of systemd being installed.
|
-- 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
|
servicefile = "/etc/systemd/system/multi-user.target.wants" </> service
|
||||||
|
|
||||||
setup = check (not <$> doesFileExist servicefile) $
|
setup = check (not <$> doesFileExist servicefile) $
|
||||||
combineProperties ("container running " ++ service)
|
started service
|
||||||
[ enabled service
|
`requires` enabled service
|
||||||
, started service
|
|
||||||
]
|
|
||||||
-- TODO ^ adjust execStart line to reflect ps
|
-- TODO ^ adjust execStart line to reflect ps
|
||||||
|
|
||||||
teardown = undefined
|
teardown = undefined
|
||||||
|
|
Loading…
Reference in New Issue