The manifest declares zfs-utils and zfs-dkms, renames scrub-pool to pool, and declares every new value not managed until set; its config file is ${config-json}, the options file, ZED's folder, rc, functions, handlers and drop-in each under their condition, the three ZFS units, the apply (run-once, restarted by its config file) and the run before the distribution's scrub and trim timers. One commit: the three subtasks change the one file module.json.
Builds: design 42 zfs-owns-zfs §6, §7, §8, §9, §11, §12, §13, §14, §15, §18, §20, A-1, A-2, A-3, A-7, A-14, A-15, A-16, A-23
21 lines
654 B
Bash
21 lines
654 B
Bash
#!/bin/sh
|
|
# shellcheck disable=SC2154
|
|
# resilver_finish-start-scrub.sh
|
|
# Run a scrub after a resilver
|
|
#
|
|
# Exit codes:
|
|
# 1: Internal error
|
|
# 2: Script wasn't enabled in zed.rc
|
|
# 3: Scrubs are automatically started for sequential resilvers
|
|
[ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc"
|
|
. "${ZED_ZEDLET_DIR}/zed-functions.sh"
|
|
|
|
[ "${ZED_SCRUB_AFTER_RESILVER}" = "1" ] || exit 2
|
|
[ "${ZEVENT_RESILVER_TYPE}" != "sequential" ] || exit 3
|
|
[ -n "${ZEVENT_POOL}" ] || exit 1
|
|
[ -n "${ZEVENT_SUBCLASS}" ] || exit 1
|
|
zed_check_cmd "${ZPOOL}" || exit 1
|
|
|
|
zed_log_msg "Starting scrub after resilver on ${ZEVENT_POOL}"
|
|
"${ZPOOL}" scrub "${ZEVENT_POOL}"
|