summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Reboot.hs
diff options
context:
space:
mode:
authorSean Whitton2016-06-12 13:01:40 +0900
committerSean Whitton2016-06-12 13:01:40 +0900
commitda8b19ea5b31637dd6a05bf662bf636b9c3e4910 (patch)
treea29b7bfc7d9aeb8cfcef578e3d28be2baf4f1572 /src/Propellor/Property/Reboot.hs
parent9ff72b7a974e5cae031b96ec9c2cf2df604acc8f (diff)
explanatory comments
Diffstat (limited to 'src/Propellor/Property/Reboot.hs')
-rw-r--r--src/Propellor/Property/Reboot.hs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/Propellor/Property/Reboot.hs b/src/Propellor/Property/Reboot.hs
index f30621d4..7733c0d2 100644
--- a/src/Propellor/Property/Reboot.hs
+++ b/src/Propellor/Property/Reboot.hs
@@ -45,17 +45,19 @@ atEnd force resultok = property "scheduled reboot at end of propellor run" $ do
--
-- This will only work if you have taken measures to ensure that the other
-- kernel won't just get booted again. See 'Propellor.Property.DigitalOcean'
--- for an example.
+-- for an example of how to do this.
toDistroKernel :: Property DebianLike
toDistroKernel = check (not <$> runningInstalledKernel) now
`describe` "running installed kernel"
-- | Given a kernel version string @v@, reboots immediately if the running
-- kernel version is strictly less than @v@ and there is an installed kernel
--- version is greater than or equal to @v@
+-- version is greater than or equal to @v@. Dies if the requested kernel
+-- version is not installed.
--
--- This assumes that the installed kernel with the highest version number is the
--- one that will be started if we reboot.
+-- For this to be useful, you need to have ensured that the installed kernel
+-- with the highest version number is the one that will be started after a
+-- reboot.
--
-- This is useful when upgrading to a new version of Debian where you need to
-- ensure that a new enough kernel is running before ensuring other properties.
@@ -69,6 +71,10 @@ toKernelNewerThan ver =
if runningV >= wantV then noChange
else if installedV >= wantV
then ensureProperty w now
+ -- We error out here because other properties
+ -- may be incorrectly ensured on a version
+ -- that's too old. E.g. Sbuild.built can fail
+ -- to add the config line `union-type=overlay`
else errorMessage ("kernel newer than "
++ ver
++ " not installed")