diff mbox series

[ndctl,v2,04/12] ndctl, config: add the default ndctl configuration file

Message ID 20211206222830.2266018-5-vishal.l.verma@intel.com (mailing list archive)
State Superseded
Headers show
Series Policy based reconfiguration for daxctl | expand

Commit Message

Verma, Vishal L Dec. 6, 2021, 10:28 p.m. UTC
From: QI Fuli <qi.fuli@fujitsu.com>

Install ndctl/ndctl.conf as the default ndctl configuration file.

Link: https://lore.kernel.org/r/20210824095106.104808-5-qi.fuli@fujitsu.com
Signed-off-by: QI Fuli <qi.fuli@fujitsu.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 configure.ac      |  2 ++
 ndctl/Makefile.am |  4 +++-
 ndctl/ndctl.conf  | 56 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 61 insertions(+), 1 deletion(-)
 create mode 100644 ndctl/ndctl.conf

Comments

Dan Williams Dec. 8, 2021, 4 p.m. UTC | #1
On Mon, Dec 6, 2021 at 2:28 PM Vishal Verma <vishal.l.verma@intel.com> wrote:
>
> From: QI Fuli <qi.fuli@fujitsu.com>
>
> Install ndctl/ndctl.conf as the default ndctl configuration file.
>
> Link: https://lore.kernel.org/r/20210824095106.104808-5-qi.fuli@fujitsu.com
> Signed-off-by: QI Fuli <qi.fuli@fujitsu.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>

Couple small fixups, otherwise:

Reviewed-by: Dan Williams <dan.j.williams@intel.com>

> ---
>  configure.ac      |  2 ++
>  ndctl/Makefile.am |  4 +++-
>  ndctl/ndctl.conf  | 56 +++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 61 insertions(+), 1 deletion(-)
>  create mode 100644 ndctl/ndctl.conf
>
> diff --git a/configure.ac b/configure.ac
> index 42a66e1..9e1c6db 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -172,8 +172,10 @@ AC_SUBST([systemd_unitdir])
>  AM_CONDITIONAL([ENABLE_SYSTEMD_UNITS], [test "x$with_systemd" = "xyes"])
>
>  ndctl_confdir=${sysconfdir}/ndctl
> +ndctl_conf=ndctl.conf
>  ndctl_monitorconf=monitor.conf
>  AC_SUBST([ndctl_confdir])
> +AC_SUBST([ndctl_conf])
>  AC_SUBST([ndctl_monitorconf])
>
>  daxctl_modprobe_datadir=${datadir}/daxctl
> diff --git a/ndctl/Makefile.am b/ndctl/Makefile.am
> index 1caa031..fceb3ab 100644
> --- a/ndctl/Makefile.am
> +++ b/ndctl/Makefile.am
> @@ -43,7 +43,7 @@ keys_configdir = $(ndctl_keysdir)
>  keys_config_DATA = $(ndctl_keysreadme)
>  endif
>
> -EXTRA_DIST += keys.readme monitor.conf ndctl-monitor.service
> +EXTRA_DIST += keys.readme monitor.conf ndctl-monitor.service ndctl.conf
>
>  if ENABLE_DESTRUCTIVE
>  ndctl_SOURCES += ../test/blk_namespaces.c \
> @@ -74,6 +74,8 @@ ndctl_SOURCES += ../test/libndctl.c \
>                  test.c
>  endif
>
> +ndctl_configdir = $(ndctl_confdir)
> +ndctl_config_DATA = $(ndctl_conf)
>  monitor_configdir = $(ndctl_confdir)
>  monitor_config_DATA = $(ndctl_monitorconf)
>
> diff --git a/ndctl/ndctl.conf b/ndctl/ndctl.conf
> new file mode 100644
> index 0000000..04d322d
> --- /dev/null
> +++ b/ndctl/ndctl.conf
> @@ -0,0 +1,56 @@
> +# This is the default ndctl configuration file. It contains the
> +# configuration directives that give ndctl instructions.
> +# Ndctl supports multiple configuration files. All files with the
> +# .conf suffix under {sysconfdir}/ndctl can be regarded as ndctl

Looks good, just the fixup to rename this to {sysconfdir}/ndctl.conf.d

...does the install process replace {sysconfdir} with /etc?

Meson makes file substitutions based on config fairly painless, so
this could wait to be fixed until after that conversion. Another
future item would be to get "man ndctl.conf" to give an overview of
ndctl configuration options.

> +# configuration files.
> +
> +# In this file, lines starting with a hash (#) are comments.
> +# The configurations should be in a [section] and follow <key> = <value>
> +# style. Multiple space-separated values are allowed, but except the
> +# following characters: : ? / \ % " ' $ & ! * { } [ ] ( ) = < > @
> +
> +[core]
> +# The values in [core] section work for all ndctl sub commands.
> +# dimm = all
> +# bus = all
> +# region = all
> +# namespace = all
> +
> +[monitor]
> +# The values in [monitor] section work for ndctl monitor.
> +# You can change the configuration of ndctl monitor by editing this
> +# file or use [--config-file=<file>] option to override this one.
> +# The changed value will work after restart ndctl monitor service.
> +
> +# The objects to monitor are filtered via dimm's name by setting key "dimm".
> +# If this value is different from the value of [--dimm=<value>] option,
> +# both of the values will work.
> +# dimm = all
> +
> +# The objects to monitor are filtered via its parent bus by setting key "bus".
> +# If this value is different from the value of [--bus=<value>] option,
> +# both of the values will work.
> +# bus = all
> +
> +# The objects to monitor are filtered via region by setting key "region".
> +# If this value is different from the value of [--region=<value>] option,
> +# both of the values will work.
> +# region = all
> +
> +# The objects to monitor are filtered via namespace by setting key "namespace".
> +# If this value is different from the value of [--namespace=<value>] option,
> +# both of the values will work.
> +# namespace = all
> +
> +# The DIMM events to monitor are filtered via event type by setting key
> +# "dimm-event". If this value is different from the value of
> +# [--dimm-event=<value>] option, both of the values will work.
> +# dimm-event = all
> +
> +# Users can choose to output the notifications to syslog (log=syslog),
> +# to standard output (log=standard) or to write into a special file (log=<file>)
> +# by setting key "log". If this value is in conflict with the value of
> +# [--log=<value>] option, this value will be ignored.
> +# Note: Setting value to "standard" or relative path for <file> will not work
> +# when running moniotr as a daemon.

s/moniotr/monitor/

> +# log = /var/log/ndctl/monitor.log
> --
> 2.33.1
>
diff mbox series

Patch

diff --git a/configure.ac b/configure.ac
index 42a66e1..9e1c6db 100644
--- a/configure.ac
+++ b/configure.ac
@@ -172,8 +172,10 @@  AC_SUBST([systemd_unitdir])
 AM_CONDITIONAL([ENABLE_SYSTEMD_UNITS], [test "x$with_systemd" = "xyes"])
 
 ndctl_confdir=${sysconfdir}/ndctl
+ndctl_conf=ndctl.conf
 ndctl_monitorconf=monitor.conf
 AC_SUBST([ndctl_confdir])
+AC_SUBST([ndctl_conf])
 AC_SUBST([ndctl_monitorconf])
 
 daxctl_modprobe_datadir=${datadir}/daxctl
diff --git a/ndctl/Makefile.am b/ndctl/Makefile.am
index 1caa031..fceb3ab 100644
--- a/ndctl/Makefile.am
+++ b/ndctl/Makefile.am
@@ -43,7 +43,7 @@  keys_configdir = $(ndctl_keysdir)
 keys_config_DATA = $(ndctl_keysreadme)
 endif
 
-EXTRA_DIST += keys.readme monitor.conf ndctl-monitor.service
+EXTRA_DIST += keys.readme monitor.conf ndctl-monitor.service ndctl.conf
 
 if ENABLE_DESTRUCTIVE
 ndctl_SOURCES += ../test/blk_namespaces.c \
@@ -74,6 +74,8 @@  ndctl_SOURCES += ../test/libndctl.c \
 		 test.c
 endif
 
+ndctl_configdir = $(ndctl_confdir)
+ndctl_config_DATA = $(ndctl_conf)
 monitor_configdir = $(ndctl_confdir)
 monitor_config_DATA = $(ndctl_monitorconf)
 
diff --git a/ndctl/ndctl.conf b/ndctl/ndctl.conf
new file mode 100644
index 0000000..04d322d
--- /dev/null
+++ b/ndctl/ndctl.conf
@@ -0,0 +1,56 @@ 
+# This is the default ndctl configuration file. It contains the
+# configuration directives that give ndctl instructions.
+# Ndctl supports multiple configuration files. All files with the
+# .conf suffix under {sysconfdir}/ndctl can be regarded as ndctl
+# configuration files.
+
+# In this file, lines starting with a hash (#) are comments.
+# The configurations should be in a [section] and follow <key> = <value>
+# style. Multiple space-separated values are allowed, but except the
+# following characters: : ? / \ % " ' $ & ! * { } [ ] ( ) = < > @
+
+[core]
+# The values in [core] section work for all ndctl sub commands.
+# dimm = all
+# bus = all
+# region = all
+# namespace = all
+
+[monitor]
+# The values in [monitor] section work for ndctl monitor.
+# You can change the configuration of ndctl monitor by editing this
+# file or use [--config-file=<file>] option to override this one.
+# The changed value will work after restart ndctl monitor service.
+
+# The objects to monitor are filtered via dimm's name by setting key "dimm".
+# If this value is different from the value of [--dimm=<value>] option,
+# both of the values will work.
+# dimm = all
+
+# The objects to monitor are filtered via its parent bus by setting key "bus".
+# If this value is different from the value of [--bus=<value>] option,
+# both of the values will work.
+# bus = all
+
+# The objects to monitor are filtered via region by setting key "region".
+# If this value is different from the value of [--region=<value>] option,
+# both of the values will work.
+# region = all
+
+# The objects to monitor are filtered via namespace by setting key "namespace".
+# If this value is different from the value of [--namespace=<value>] option,
+# both of the values will work.
+# namespace = all
+
+# The DIMM events to monitor are filtered via event type by setting key
+# "dimm-event". If this value is different from the value of
+# [--dimm-event=<value>] option, both of the values will work.
+# dimm-event = all
+
+# Users can choose to output the notifications to syslog (log=syslog),
+# to standard output (log=standard) or to write into a special file (log=<file>)
+# by setting key "log". If this value is in conflict with the value of
+# [--log=<value>] option, this value will be ignored.
+# Note: Setting value to "standard" or relative path for <file> will not work
+# when running moniotr as a daemon.
+# log = /var/log/ndctl/monitor.log