forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add zettacache support to zfs-object-agent.service (openzfs#428)
- Loading branch information
1 parent
5b56f9d
commit 36f05f1
Showing
8 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
dist_bin_SCRIPTS = zoa_chaos_monkey | ||
dist_bin_SCRIPTS = \ | ||
zoa_chaos_monkey \ | ||
start_zoa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
|
||
# | ||
# This script starts the ZFS Object Agent process. | ||
# It uses the following environment variables, typically set by zfs-object-agent.service | ||
# to determine which command line parameters to pass to the ZFS Object Agent process. | ||
# - ZOA_LOG: File to log output to | ||
# - ZOA_CONFIG: Configuration file to set tunables (toml/json/yaml" | ||
# - ZETTACACHE_DEVICE: File/device to use for ZettaCache | ||
# - ZOA_LOG_LEVEL : Sets the level of logging verbosity. | ||
# Values can be TRACE, DEBUG, INFO, WARN. | ||
# | ||
|
||
error() { | ||
echo "$@" 1>&2 | ||
} | ||
|
||
ZOA_LOG="${ZOA_LOG:-/var/log/zoa.log}" | ||
PARAMS="-o ${ZOA_LOG}" | ||
echo "Logging to: ${ZOA_LOG}" | ||
|
||
if [ ! -z $ZOA_CONFIG ]; then | ||
echo "Config file: ${ZOA_CONFIG}" | ||
PARAMS="${PARAMS} -t ${ZOA_CONFIG}" | ||
fi | ||
|
||
if [ ! -z $ZETTACACHE_DEVICE ]; then | ||
echo "ZettaCache: ${ZETTACACHE_DEVICE}" | ||
PARAMS="$PARAMS -c ${ZETTACACHE_DEVICE}" | ||
fi | ||
|
||
if [ ! -z $ZOA_LOG_LEVEL ]; then | ||
if [ $ZOA_LOG_LEVEL = 'WARN' ]; then | ||
: # WARN is the default log level. | ||
elif [ $ZOA_LOG_LEVEL = 'INFO' ]; then | ||
PARAMS="${PARAMS} -v" | ||
elif [ $ZOA_LOG_LEVEL = 'DEBUG' ]; then | ||
PARAMS="${PARAMS} -vv" | ||
elif [ $ZOA_LOG_LEVEL = 'TRACE' ]; then | ||
PARAMS="${PARAMS} -vvv" | ||
else | ||
error "Invalid log level setting: $ZOA_LOG_LEVEL; ignoring." | ||
fi | ||
fi | ||
|
||
/sbin/zfs_object_agent ${PARAMS} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ZOA_LOG=/var/log/zoa.log | ||
ZOA_LOG_LEVEL=DEBUG | ||
ZOA_CONFIG=/etc/zfs/zoa_config.toml | ||
ZETTACACHE_DEVICE= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# | ||
# This config file overrides default values for tunable parameters in | ||
# the ZFS Object Agent. | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters