Z1 Z2 Z3 zfs-manifest: packages and values, files and units, the apply and the run in the declared order
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
This commit is contained in:
+382
-77
@@ -2,52 +2,151 @@
|
||||
"module": "zfs",
|
||||
"version": "1",
|
||||
"capabilities": [
|
||||
"package-manager",
|
||||
"service-manager"
|
||||
],
|
||||
"emits": [
|
||||
"snapshot.taken",
|
||||
"scrub.requested"
|
||||
],
|
||||
"config": {
|
||||
"scrub-pool": {
|
||||
"type": "string",
|
||||
"description": "The name of the ZFS pool the module scrubs; the operator's, with no default.",
|
||||
"trusted": true,
|
||||
"required": true
|
||||
},
|
||||
"scrub-cadence": {
|
||||
"type": "string",
|
||||
"description": "How often the pool named by scrub-pool is scrubbed: weekly, or monthly on the first scrub-day of each month. Weekly is what the distribution's timer did on the home server before the module, so taking it over moves nothing until the operator chooses.",
|
||||
"enum": [
|
||||
"weekly",
|
||||
"monthly"
|
||||
],
|
||||
"trusted": true,
|
||||
"default": "weekly"
|
||||
},
|
||||
"scrub-day": {
|
||||
"type": "string",
|
||||
"description": "The weekday the scrub starts, Mon to Sun; for a monthly scrub, the first such day of the month. Checked by the scheduled run, which refuses any other value and runs nothing; Monday is when the distribution's weekly timer fired.",
|
||||
"enum": [
|
||||
"Mon",
|
||||
"Tue",
|
||||
"Wed",
|
||||
"Thu",
|
||||
"Fri",
|
||||
"Sat",
|
||||
"Sun"
|
||||
],
|
||||
"trusted": true,
|
||||
"default": "Mon"
|
||||
},
|
||||
"scrub-time": {
|
||||
"type": "string",
|
||||
"description": "The time the scrub starts, HH:MM from 00:00 to 23:59 in the machine's time zone; the scheduled run checks it every quarter of an hour, so the scrub starts within 15 minutes of it. Midnight is when the distribution's weekly timer fired.",
|
||||
"pattern": "([01][0-9]|2[0-3]):[0-5][0-9]",
|
||||
"trusted": true,
|
||||
"default": "00:00"
|
||||
}
|
||||
"config": {
|
||||
"pool": {
|
||||
"type": "string",
|
||||
"description": "The name of the ZFS pool the module owns: scrubs, trims, takes scheduled ZFS snapshots of and converges; the operator's, with no default.",
|
||||
"trusted": true,
|
||||
"required": true,
|
||||
"renamed-from": "scrub-pool"
|
||||
},
|
||||
"scrub-cadence": {
|
||||
"type": "string",
|
||||
"description": "How often the pool named by pool is scrubbed: weekly, or monthly on the first scrub-day of each month. Weekly is what the distribution's timer did on the home server before the module, so taking it over moves nothing until the operator chooses.",
|
||||
"enum": [
|
||||
"weekly",
|
||||
"monthly"
|
||||
],
|
||||
"trusted": true,
|
||||
"default": "weekly"
|
||||
},
|
||||
"scrub-day": {
|
||||
"type": "string",
|
||||
"description": "The weekday the scrub starts, Mon to Sun; for a monthly scrub, the first such day of the month. Checked by the scheduled run, which refuses any other value and runs nothing; Monday is when the distribution's weekly timer fired.",
|
||||
"enum": [
|
||||
"Mon",
|
||||
"Tue",
|
||||
"Wed",
|
||||
"Thu",
|
||||
"Fri",
|
||||
"Sat",
|
||||
"Sun"
|
||||
],
|
||||
"trusted": true,
|
||||
"default": "Mon"
|
||||
},
|
||||
"scrub-time": {
|
||||
"type": "string",
|
||||
"description": "The time the scrub starts, HH:MM from 00:00 to 23:59 in the machine's time zone; the scheduled run checks it every quarter of an hour, so the scrub starts within 15 minutes of it. Midnight is when the distribution's weekly timer fired.",
|
||||
"pattern": "([01][0-9]|2[0-3]):[0-5][0-9]",
|
||||
"trusted": true,
|
||||
"default": "00:00"
|
||||
},
|
||||
"arc-max": {
|
||||
"type": "number",
|
||||
"description": "The most ZFS's read cache in memory (the ARC) may hold, in whole MiB: at least 64 and below the node's memory. Written live and into the options file. Not managed until set.",
|
||||
"minimum": 64,
|
||||
"trusted": false
|
||||
},
|
||||
"arc-min": {
|
||||
"type": "number",
|
||||
"description": "The least the ARC keeps, in whole MiB, not above arc-max. Written live and into the options file. Not managed until set.",
|
||||
"minimum": 0,
|
||||
"trusted": false
|
||||
},
|
||||
"module-options": {
|
||||
"type": "list",
|
||||
"description": "Kernel module parameters, each name=digits, from l2arc_write_max, l2arc_write_boost, l2arc_headroom, l2arc_noprefetch, l2arc_rebuild_enabled, zfs_txg_timeout, zfs_dirty_data_max, zfs_scan_vdev_limit, zfs_scrub_min_time_ms, zfs_resilver_min_time_ms and zfs_arc_sys_free (arc-max and arc-min hold the ARC's). Written into the options file; a live one is also written live, the others take effect at the next load of the kernel module. An empty list is not managed.",
|
||||
"trusted": true
|
||||
},
|
||||
"hostid": {
|
||||
"type": "string",
|
||||
"description": "The node's ZFS id: eight hexadecimal digits, not all zero, written to /etc/hostid with ZFS's own writer only when the pool's label holds 0 or this value. Changing it needs a check of the pool's import at the next boot; the module never reboots. Not managed until set.",
|
||||
"pattern": "^[0-9a-fA-F]{8}$",
|
||||
"trusted": true
|
||||
},
|
||||
"zed": {
|
||||
"type": "string",
|
||||
"description": "Whether the ZFS event daemon runs from the module's own folder: on or off. Not managed until set.",
|
||||
"enum": [
|
||||
"on",
|
||||
"off"
|
||||
],
|
||||
"trusted": false
|
||||
},
|
||||
"zed-handlers": {
|
||||
"type": "list",
|
||||
"description": "The event handlers placed in the module's folder: all-syslog (the journal handler) and resilver_finish-start-scrub (a scrub after a resilver). Empty is not managed.",
|
||||
"trusted": true
|
||||
},
|
||||
"trim-schedule": {
|
||||
"type": "string",
|
||||
"description": "How often the pool is trimmed by the scheduled run: none, weekly, or monthly on the first trim-day of each month. Any set value holds the distribution's trim timers stopped. Needs trim-day and trim-time for weekly and monthly. Not managed until set.",
|
||||
"enum": [
|
||||
"none",
|
||||
"weekly",
|
||||
"monthly"
|
||||
],
|
||||
"trusted": false
|
||||
},
|
||||
"trim-day": {
|
||||
"type": "string",
|
||||
"description": "The weekday the trim starts, Mon to Sun; for monthly, the first such day of the month. Not managed until set.",
|
||||
"enum": [
|
||||
"Mon",
|
||||
"Tue",
|
||||
"Wed",
|
||||
"Thu",
|
||||
"Fri",
|
||||
"Sat",
|
||||
"Sun"
|
||||
],
|
||||
"trusted": false
|
||||
},
|
||||
"trim-time": {
|
||||
"type": "string",
|
||||
"description": "The time the trim starts, HH:MM in the machine's time zone, within 15 minutes. Not managed until set.",
|
||||
"pattern": "([01][0-9]|2[0-3]):[0-5][0-9]",
|
||||
"trusted": false
|
||||
},
|
||||
"cache-devices": {
|
||||
"type": "list",
|
||||
"description": "The pool's cache devices, by their names under /dev/disk/by-id: letters, digits, -, _, . and : only. A kernel-named member is re-added by its stable name; an empty list removes nothing and is not managed.",
|
||||
"trusted": true
|
||||
},
|
||||
"log-devices": {
|
||||
"type": "list",
|
||||
"description": "The pool's log devices, by their names under /dev/disk/by-id. An empty list removes nothing and is not managed.",
|
||||
"trusted": true
|
||||
},
|
||||
"log-mirror": {
|
||||
"type": "boolean",
|
||||
"description": "Whether log-devices are one mirror: true needs exactly two names, added as one mirror; otherwise each is a log device of its own. Not managed until set.",
|
||||
"trusted": true
|
||||
},
|
||||
"pool-properties": {
|
||||
"type": "object",
|
||||
"description": "The pool's properties: autotrim, autoexpand, autoreplace (on, off or default) and failmode (wait, continue, panic or default). Not managed until set.",
|
||||
"trusted": true
|
||||
},
|
||||
"dataset-properties": {
|
||||
"type": "object",
|
||||
"description": "Per dataset of the pool, its properties: compression, atime, relatime, recordsize, primarycache, secondarycache, sync, logbias, quota and reservation, each in its own form; never sharenfs or sharesmb. Not managed until set.",
|
||||
"trusted": true
|
||||
},
|
||||
"snapshots": {
|
||||
"type": "object",
|
||||
"description": "The scheduled ZFS snapshots of every filesystem of the pool: {\"none\": true}, or keep counts hourly, daily, weekly and monthly, each a whole number from 0 to 168; a count of 0 takes none of that kind and removes none. Only snapshots the module took, named mesh-<kind>-<UTC stamp> and recorded in its ledger, are ever removed. Not managed until set.",
|
||||
"trusted": true
|
||||
}
|
||||
},
|
||||
"tools": [
|
||||
"zfs_datasets",
|
||||
"zfs_snapshots",
|
||||
@@ -129,6 +228,224 @@
|
||||
]
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"id": "utils",
|
||||
"type": "package",
|
||||
"package": "zfs-utils"
|
||||
},
|
||||
{
|
||||
"id": "dkms",
|
||||
"type": "package",
|
||||
"package": "zfs-dkms"
|
||||
},
|
||||
{
|
||||
"id": "state-dir",
|
||||
"type": "directory",
|
||||
"path": "/var/lib/zfs-tools",
|
||||
"mode": "0755",
|
||||
"owner": "${machine:account}",
|
||||
"unknown": "program"
|
||||
},
|
||||
{
|
||||
"id": "cursor-dir",
|
||||
"type": "directory",
|
||||
"path": "/run/zfs-events",
|
||||
"mode": "0700",
|
||||
"unknown": "program"
|
||||
},
|
||||
{
|
||||
"id": "run-dir",
|
||||
"type": "directory",
|
||||
"path": "/run/zfs-tools",
|
||||
"mode": "0755",
|
||||
"unknown": "program"
|
||||
},
|
||||
{
|
||||
"id": "config-dir",
|
||||
"type": "directory",
|
||||
"path": "/etc/zfs-tools",
|
||||
"mode": "0755",
|
||||
"unknown": "program"
|
||||
},
|
||||
{
|
||||
"id": "scrub-state-dir",
|
||||
"type": "directory",
|
||||
"path": "/var/lib/zfs-scrub",
|
||||
"mode": "0700",
|
||||
"unknown": "program"
|
||||
},
|
||||
{
|
||||
"id": "config",
|
||||
"type": "file",
|
||||
"path": "/etc/zfs-tools/config.json",
|
||||
"mode": "0644",
|
||||
"template": "files/config.json",
|
||||
"trusted": false
|
||||
},
|
||||
{
|
||||
"id": "options",
|
||||
"type": "file",
|
||||
"path": "/etc/modprobe.d/zfs.conf",
|
||||
"mode": "0644",
|
||||
"template": "files/zfs.conf",
|
||||
"if-config": [
|
||||
"arc-max",
|
||||
"arc-min",
|
||||
"module-options"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "zed-dir",
|
||||
"type": "directory",
|
||||
"path": "/etc/zfs/mesh-zed.d",
|
||||
"mode": "0755",
|
||||
"unknown": "module",
|
||||
"if-config": [
|
||||
"zed=on"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "zed-rc",
|
||||
"type": "file",
|
||||
"path": "/etc/zfs/mesh-zed.d/zed.rc",
|
||||
"mode": "0644",
|
||||
"template": "files/zed.rc",
|
||||
"if-config": [
|
||||
"zed=on"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "zed-functions",
|
||||
"type": "file",
|
||||
"path": "/etc/zfs/mesh-zed.d/zed-functions.sh",
|
||||
"mode": "0644",
|
||||
"template": "files/zed-functions.sh",
|
||||
"if-config": [
|
||||
"zed=on"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "zed-handler-all-syslog",
|
||||
"type": "file",
|
||||
"path": "/etc/zfs/mesh-zed.d/all-syslog.sh",
|
||||
"mode": "0755",
|
||||
"template": "files/all-syslog.sh",
|
||||
"if-config": [
|
||||
"zed-handlers=all-syslog"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "zed-handler-scrub-after-resilver",
|
||||
"type": "file",
|
||||
"path": "/etc/zfs/mesh-zed.d/resilver_finish-start-scrub.sh",
|
||||
"mode": "0755",
|
||||
"template": "files/resilver_finish-start-scrub.sh",
|
||||
"if-config": [
|
||||
"zed-handlers=resilver_finish-start-scrub"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "zed-drop-ins",
|
||||
"type": "directory",
|
||||
"path": "/etc/systemd/system/zfs-zed.service.d",
|
||||
"mode": "0755",
|
||||
"unknown": "program",
|
||||
"if-config": [
|
||||
"zed=on"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "zed-drop-in",
|
||||
"type": "file",
|
||||
"path": "/etc/systemd/system/zfs-zed.service.d/mesh.conf",
|
||||
"mode": "0644",
|
||||
"template": "files/zed-mesh.conf",
|
||||
"if-config": [
|
||||
"zed=on"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "import-cache",
|
||||
"type": "service",
|
||||
"unit": "zfs-import-cache.service",
|
||||
"state": "running",
|
||||
"boot": "enabled"
|
||||
},
|
||||
{
|
||||
"id": "mount",
|
||||
"type": "service",
|
||||
"unit": "zfs-mount.service",
|
||||
"state": "running",
|
||||
"boot": "enabled"
|
||||
},
|
||||
{
|
||||
"id": "target",
|
||||
"type": "service",
|
||||
"unit": "zfs.target",
|
||||
"state": "running",
|
||||
"boot": "enabled"
|
||||
},
|
||||
{
|
||||
"id": "import-scan",
|
||||
"type": "service",
|
||||
"unit": "zfs-import-scan.service"
|
||||
},
|
||||
{
|
||||
"id": "share",
|
||||
"type": "service",
|
||||
"unit": "zfs-share.service"
|
||||
},
|
||||
{
|
||||
"id": "volume-wait",
|
||||
"type": "service",
|
||||
"unit": "zfs-volume-wait.service"
|
||||
},
|
||||
{
|
||||
"id": "import-target",
|
||||
"type": "service",
|
||||
"unit": "zfs-import.target"
|
||||
},
|
||||
{
|
||||
"id": "zed-on",
|
||||
"type": "service",
|
||||
"unit": "zfs-zed.service",
|
||||
"state": "running",
|
||||
"boot": "enabled",
|
||||
"if-config": [
|
||||
"zed=on"
|
||||
],
|
||||
"restart-on": [
|
||||
"zed-rc",
|
||||
"zed-functions",
|
||||
"zed-handler-all-syslog",
|
||||
"zed-handler-scrub-after-resilver",
|
||||
"zed-drop-in"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "zed-off",
|
||||
"type": "service",
|
||||
"unit": "zfs-zed.service",
|
||||
"state": "stopped",
|
||||
"boot": "disabled",
|
||||
"if-config": [
|
||||
"zed=off"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "apply",
|
||||
"type": "process",
|
||||
"name": "zfs-config-apply",
|
||||
"artifact": "tools",
|
||||
"run": [
|
||||
"./zfs-tools",
|
||||
"apply"
|
||||
],
|
||||
"run-once": true,
|
||||
"restart-on": [
|
||||
"config"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "watch",
|
||||
"type": "process",
|
||||
@@ -148,21 +465,6 @@
|
||||
"grace": "60s"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "state-dir",
|
||||
"type": "directory",
|
||||
"path": "/var/lib/zfs-tools",
|
||||
"mode": "0755",
|
||||
"owner": "${machine:account}",
|
||||
"unknown": "program"
|
||||
},
|
||||
{
|
||||
"id": "cursor-dir",
|
||||
"type": "directory",
|
||||
"path": "/run/zfs-events",
|
||||
"mode": "0700",
|
||||
"unknown": "program"
|
||||
},
|
||||
{
|
||||
"id": "events",
|
||||
"type": "process",
|
||||
@@ -176,27 +478,6 @@
|
||||
"kind": "unit"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "config-dir",
|
||||
"type": "directory",
|
||||
"path": "/etc/zfs-tools",
|
||||
"mode": "0755",
|
||||
"unknown": "program"
|
||||
},
|
||||
{
|
||||
"id": "scrub-config",
|
||||
"type": "file",
|
||||
"path": "/etc/zfs-tools/scrub.conf",
|
||||
"mode": "0644",
|
||||
"template": "files/scrub.conf"
|
||||
},
|
||||
{
|
||||
"id": "scrub-state-dir",
|
||||
"type": "directory",
|
||||
"path": "/var/lib/zfs-scrub",
|
||||
"mode": "0700",
|
||||
"unknown": "program"
|
||||
},
|
||||
{
|
||||
"id": "run",
|
||||
"type": "process",
|
||||
@@ -211,16 +492,40 @@
|
||||
{
|
||||
"id": "distribution-weekly",
|
||||
"type": "service",
|
||||
"unit": "zfs-scrub-weekly@${config:scrub-pool}.timer",
|
||||
"unit": "zfs-scrub-weekly@${config:pool}.timer",
|
||||
"state": "stopped",
|
||||
"boot": "disabled"
|
||||
},
|
||||
{
|
||||
"id": "distribution-monthly",
|
||||
"type": "service",
|
||||
"unit": "zfs-scrub-monthly@${config:scrub-pool}.timer",
|
||||
"unit": "zfs-scrub-monthly@${config:pool}.timer",
|
||||
"state": "stopped",
|
||||
"boot": "disabled"
|
||||
},
|
||||
{
|
||||
"id": "distribution-trim-weekly",
|
||||
"type": "service",
|
||||
"unit": "zfs-trim-weekly@${config:pool}.timer",
|
||||
"state": "stopped",
|
||||
"boot": "disabled",
|
||||
"if-config": [
|
||||
"trim-schedule=none",
|
||||
"trim-schedule=weekly",
|
||||
"trim-schedule=monthly"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "distribution-trim-monthly",
|
||||
"type": "service",
|
||||
"unit": "zfs-trim-monthly@${config:pool}.timer",
|
||||
"state": "stopped",
|
||||
"boot": "disabled",
|
||||
"if-config": [
|
||||
"trim-schedule=none",
|
||||
"trim-schedule=weekly",
|
||||
"trim-schedule=monthly"
|
||||
]
|
||||
}
|
||||
],
|
||||
"build": {
|
||||
|
||||
Reference in New Issue
Block a user