Safe Haskell | None |
---|---|
Language | Haskell2010 |
Propellor.Property.Reboot
Synopsis
- now :: Property Linux
- atEnd :: Force -> (Result -> Bool) -> Property Linux
- toDistroKernel :: Property DebianLike
- toKernelNewerThan :: KernelVersion -> Property DebianLike
- type KernelVersion = String
Documentation
now :: Property Linux Source #
Using this property causes an immediate reboot.
So, this is not a useful property on its own, but it can be useful to compose with other properties. For example:
Apt.installed ["new-kernel"] `onChange` Reboot.now
atEnd :: Force -> (Result -> Bool) -> Property Linux Source #
Schedules a reboot at the end of the current propellor run.
The Result
code of the entire propellor run can be checked;
the reboot proceeds only if the function returns True.
The reboot can be forced to run, which bypasses the init system. Useful if the init system might not be running for some reason.
toDistroKernel :: Property DebianLike Source #
Reboots immediately if a kernel other than the distro-installed kernel is running.
This will only work if you have taken measures to ensure that the other
kernel won't just get booted again.
See DigitalOcean
for an example of how to do this.
toKernelNewerThan :: KernelVersion -> Property DebianLike Source #
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
. Fails if the requested kernel
version is not installed.
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.
type KernelVersion = String Source #
Kernel version number, in a string.