|
Rose Hellsing
319354ce2b
dist/init: remove supervise-daemon
boot_bless doesn't run as a daemon, making it run through supervise-daemon causes openrc to relaunch it multiple times |
||
|---|---|---|
| dist | dist/init: remove supervise-daemon | |
| usr/bin | Fix quoted find paths | |
| .gitignore | boot_bless: Add initial version of boot_bless | |
| boot_bless.conf | boot_bless: Add initial version of boot_bless | |
| COPYING | boot_bless: Add initial version of boot_bless | |
| README.md | Add option to skip scripts | |
boot_bless
A simple tool to check the integrity of the booted system and take appropriate steps in the case of a failed boot.
Configuration
boot_bless can be configured through the file /etc/boot_bless.d/boot_bless.conf:
TMPDIR="/tmp" # An alternative temporary directory. Preferrably a truly temporary (i.e. tmpfs) directory
REQUIRED_CHECK_DIRS="/etc/boot_bless.d/required" # Directories containing required checks
OPTIONAL_CHECK_DIRS="/etc/boot_bless.d/optional" # Directories containing optional checks
SUCCESS_BOOT_DIRS="/etc/boot_bless.d/success" # Directories containing scripts to execute on a successfull boot
FAILED_BOOT_DIRS="/etc/boot_bless.d/failed" # Directories containing scripts to execute on a failed boot
MOTD_FILE="/etc/motd" # Path to the motd. If the motd should not be modified, set this to /dev/null
LOGGERARGS="--id='boot_bless'" # Extra arguments to pass to logger(1)
LOGFILE="/var/log/boot_bless" # Path to the logfile
SKIP_SCRIPTS="" # Exact filenames of scripts to skip
All options are optional, and will default to the value shown in the example config above. The DIRS options may contain paths to multiple directories seperated by spaces.
Required checks
Required checks may NOT fail to be counted as successfull. If a script fail the boot will be marked as RED/failed.
Optional checks
Optional checks may fail, if an optional script fails the boot will be marked as YELLOW/unstable.
Success scripts
These scripts will be executed if required checks did not fail. While they should not fail, boot_bless will only log their exit codes and ignore script failure.
Fail scripts
These scripts will be executed if required checks fail. While they should not fail, boot_bless will only log their exit codes and ignore script failure.
Checking the boot status
boot_bless writes the status to ${TMPDIR}/.boot_bless_status. It can be read as a regular file or using boot_bless status. boot_bless will also append the boot status to the motd file defined in the config file.
Integrating with the system
boot_bless works best when started by the init system as the last service. View dist/ for an example openrc init script and various required/optional/success/failed scripts.
Logging
boot_bless will log using logger(1) if it was found in PATH, the arguments contained in LOGGERARGS will be added to the command. If logger(1) was not found in the system, log messages will simple be concatenated to the file specified in LOGFILE.