From 87284da7a28172b40504eb50510a8b57da6692a6 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Tue, 24 Apr 2018 15:55:11 +1000 Subject: [PATCH] ctdb: Drop configuration file ctdbd.conf Drop function loadconfig(), replacing uses with "load_system_config ctdb". Drop translation of old-style configuration to new configuration file. Drop export of debugging variables. Drop documentation and configuration examples. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Amitay Isaacs Autobuild-Date(master): Thu May 17 07:03:04 CEST 2018 on sn-devel-144 --- ctdb/config/ctdbd.conf | 20 -- ctdb/config/ctdbd_wrapper | 91 +------ ctdb/config/functions | 12 - ctdb/doc/ctdb-script.options.5.xml | 7 - ctdb/doc/ctdb-tunables.7.xml | 3 - ctdb/doc/ctdb.7.xml | 3 - ctdb/doc/ctdbd.conf.5.xml | 401 ----------------------------- ctdb/doc/ctdbd_wrapper.1.xml | 10 - ctdb/doc/examples/README | 6 - ctdb/doc/examples/cluster.conf | 87 ------- ctdb/doc/examples/lvs.conf | 88 ------- ctdb/doc/examples/natgw.conf | 104 -------- ctdb/packaging/RPM/ctdb.spec.in | 3 - ctdb/wscript | 1 - 14 files changed, 1 insertion(+), 835 deletions(-) delete mode 100644 ctdb/config/ctdbd.conf delete mode 100644 ctdb/doc/ctdbd.conf.5.xml delete mode 100644 ctdb/doc/examples/cluster.conf delete mode 100644 ctdb/doc/examples/lvs.conf delete mode 100644 ctdb/doc/examples/natgw.conf diff --git a/ctdb/config/ctdbd.conf b/ctdb/config/ctdbd.conf deleted file mode 100644 index 57cb3495c1b..00000000000 --- a/ctdb/config/ctdbd.conf +++ /dev/null @@ -1,20 +0,0 @@ -# Options to ctdbd, read by ctdbd_wrapper(1) -# -# See ctdbd.conf(5) for more information about CTDB configuration variables. - -# Shared recovery lock file to avoid split brain. No default. -# -# Do NOT run CTDB without a recovery lock file unless you know exactly -# what you are doing. -# CTDB_RECOVERY_LOCK=/some/place/on/shared/storage - -# What services should CTDB manage? Default is none. -# CTDB_MANAGES_SAMBA=yes -# CTDB_MANAGES_WINBIND=yes -# CTDB_MANAGES_NFS=yes - -# Default is to use the log file below instead of syslog. -# CTDB_LOGGING=file:/var/log/log.ctdb - -# Default log level is NOTICE. Want less logging? -# CTDB_DEBUGLEVEL=ERR diff --git a/ctdb/config/ctdbd_wrapper b/ctdb/config/ctdbd_wrapper index a3c9db3ea8f..34827eaaa29 100755 --- a/ctdb/config/ctdbd_wrapper +++ b/ctdb/config/ctdbd_wrapper @@ -20,103 +20,14 @@ fi . "${CTDB_BASE}/functions" -loadconfig +load_system_config "ctdb" ctdbd="${CTDBD:-/usr/local/sbin/ctdbd}" ############################################################ -# Only the nested function references its arguments -# shellcheck disable=SC2120 -build_ctdb_options () -{ - maybe_set () - { - _section="$1" - _key="$2" - _val="$3" - _check="$4" - - # If the given variable isn't set then do nothing - [ -n "$_val" ] || return - # If a value is required for the variable and it doesn't - # match, then do nothing - if [ -n "$_check" -a "$_check" != "$_val" ] ; then - return - fi - - # Configuration file handling needs true/false, not yes/no - case "$_val" in - yes) _val="true" ;; - no) _val="false" ;; - esac - - if grep -q "^\\[${_section}\\]\\$" "$_conf_file" ; then - # Section already exists... - # Must escape leading TAB or sed eats it - sed -i -e "/\\[${_section}\\]/a\ -\\ ${_key} = ${_val} -" "${_conf_file}" - else - # Section does not exist and needs to be created... - # Note literal TAB for indentation in here document - cat >>"${_conf_file}" < - - For short-term backward compatibility the CTDB configuration - file (see - ctdbd.conf - 5) is also loaded. - - These files should include simple shell-style variable assignments and shell-style comments. diff --git a/ctdb/doc/ctdb-tunables.7.xml b/ctdb/doc/ctdb-tunables.7.xml index 317add4b63a..75a3b01c14d 100644 --- a/ctdb/doc/ctdb-tunables.7.xml +++ b/ctdb/doc/ctdb-tunables.7.xml @@ -781,9 +781,6 @@ MonitorInterval=20 ctdb.conf 5, - ctdbd.conf - 5, - ctdb 7, diff --git a/ctdb/doc/ctdb.7.xml b/ctdb/doc/ctdb.7.xml index eb283a834c3..6902e574eae 100644 --- a/ctdb/doc/ctdb.7.xml +++ b/ctdb/doc/ctdb.7.xml @@ -1079,9 +1079,6 @@ CTDB_CAPABILITY_RECMASTER=no ctdb.conf 5, - ctdbd.conf - 5, - ctdb-script.options 5, diff --git a/ctdb/doc/ctdbd.conf.5.xml b/ctdb/doc/ctdbd.conf.5.xml deleted file mode 100644 index 624a84f48ad..00000000000 --- a/ctdb/doc/ctdbd.conf.5.xml +++ /dev/null @@ -1,401 +0,0 @@ - - - - - - - ctdbd.conf - 5 - ctdb - CTDB - clustered TDB database - - - - ctdbd.conf - CTDB daemon configuration file - - - - DESCRIPTION - - - This file contains CTDB configuration variables that are affect - the operation of CTDB. The default location of this file is - /usr/local/etc/ctdb/ctdbd.conf. - - - - This file is a shell script (see - sh - 1) but is usually limited - to simple variable assignments and shell-style comments. - - - - CTDB configuration variables are grouped into several categories below. - - - - Variables defined in this document can also be set in a - distribution-specific configuration file such as - /etc/sysconfig/ctdb (Red Hat) or - /etc/default/ctdb (Debian). However, these - files should be reserved for variables used by the initscript. - A historical alternative is - /usr/local/etc/ctdb/sysconfig/ctdb - this is - deprecated. - - - - - - - DAEMON CONFIGURATION - - - - Variables in this section are processed by - ctdbd_wrapper - 1 and are converted into - command-line arguments to - ctdbd - 1. - - - - Many of these variables are also used by event scripts. - - - - - - CTDB_CAPABILITY_LMASTER=yes|no - - - Defaults to yes. - - - - - - CTDB_CAPABILITY_RECMASTER=yes|no - - - Defaults to yes. - - - - - - CTDB_DBDIR=DIRECTORY - - - Defaults to /usr/local/var/lib/ctdb/volatile. - - - - - - CTDB_DBDIR_PERSISTENT=DIRECTORY - - - Defaults to /usr/local/var/lib/ctdb/persistent. - - - - - - CTDB_DBDIR_STATE=DIRECTORY - - - Defaults to /usr/local/var/lib/ctdb/state. - - - - - - CTDB_DEBUG_HUNG_SCRIPT=FILENAME - - - FILENAME is a script to run to log debug information when - an event script times out. - - - Default is /usr/local/etc/ctdb/debug-hung-script.sh. - - - - - - CTDB_DEBUG_LOCKS=FILENAME - - - FILENAME is a script to run to log debug information when - an CTDB fails to freeze databases during recovery. - - - No default, usually - /usr/local/etc/ctdb/debug_locks.sh. - - - - - - CTDB_DEBUGLEVEL=DEBUGLEVEL - - - Default is NOTICE. - - - - - - CTDB_LOGGING=STRING - - - STRING specifies where ctdbd will write its log. The - default is - file:/usr/local/var/log/log.ctdb. - - - Valid values are: - - - - file:FILENAME - - - FILENAME where ctdbd will write its log. This is usually - /usr/local/var/log/log.ctdb. - - - - - syslog:METHOD - - - CTDB will log to syslog. By default this will use - the syslog(3) API. - - - If METHOD is specified then it specifies an - extension that causes logging to be done in a - non-blocking fashion. This can be useful under - heavy loads that might cause the syslog daemon to - dequeue messages too slowly, which would otherwise - cause CTDB to block when logging. METHOD must be - one of: - - - - nonblocking - - - CTDB will log to syslog via - /dev/log in non-blocking - mode. - - - - - udp - - - CTDB will log to syslog via UDP to - localhost:514. The syslog daemon must be - configured to listen on (at least) - localhost:514. Most implementations will log - the messages against hostname "localhost" - - this is a limit of the implementation for - compatibility with more syslog daemon - implementations. - - - - - udp-rfc5424 - - - As with "udp" but messages are sent in RFC5424 - format. This method will log the correct - hostname but is not as widely implemented in - syslog daemons. - - - - - - - - - - - - CTDB_NOSETSCHED=yes|no - - - Defaults to no. - - - Usually CTDB runs with real-time priority. If you are running - CTDB on a platform that does not support real-time priority, - you can set this. - - - - - - CTDB_NODE_ADDRESS=IPADDR - - - IPADDR is the private IP address that ctdbd will bind to. - - - By default ctdbd will select the first address from the - nodes list that in can bind to. See also the - Private address section in - ctdb - 7. - - - This option is only required when automatic address - detection can not be used. This can be the case when - running multiple ctdbd daemons/nodes on the same physical - host (usually for testing), using InfiniBand for the - private network or on Linux when sysctl - net.ipv4.ip_nonlocal_bind=1. - - - - - - CTDB_RECOVERY_LOCK=LOCK - - - LOCK specifies the cluster-wide mutex used to detect and - prevent a partitioned cluster (or "split brain"). - - - No default, but the default configuration file specifies - /some/place/on/shared/storage, which - should be change to a useful value. - - - For information about the recovery lock please see the - RECOVERY LOCK section in - ctdb - 7. - - - - - - CTDB_SCRIPT_LOG_LEVEL=DEBUGLEVEL - - - Defaults to ERR. - - - - - - CTDB_START_AS_DISABLED=yes|no - - - Default is no. - - - - - - CTDB_START_AS_STOPPED=yes|no - - - Default is no. - - - - - - CTDB_TRANSPORT=tcp|infiniband - - - Defaults to tcp. - - - - - - - - - - FILES - - - /usr/local/etc/ctdb/ctdbd.conf - /etc/sysconfig/ctdb - /etc/default/ctdb - - - - - SEE ALSO - - ctdbd - 1, - - ctdbd_wrapper - 1, - - onnode - 1, - - ctdb - 7, - - ctdb-tunables - 7, - - - - - - - - - This documentation was written by - Amitay Isaacs, - Martin Schwenke - - - - - 2007 - Andrew Tridgell - Ronnie Sahlberg - - - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 3 of - the License, or (at your option) any later version. - - - This program is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied - warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the GNU General Public License for more details. - - - You should have received a copy of the GNU General Public - License along with this program; if not, see - . - - - - - diff --git a/ctdb/doc/ctdbd_wrapper.1.xml b/ctdb/doc/ctdbd_wrapper.1.xml index d717b84d2bd..a1b92e3ef89 100644 --- a/ctdb/doc/ctdbd_wrapper.1.xml +++ b/ctdb/doc/ctdbd_wrapper.1.xml @@ -39,13 +39,6 @@ file containing the PID of the main CTDB daemon. - - ctdbd_wrapper constructs command-line options for ctdbd from - configuration variables specified in - ctdbd.conf - 5. - - See ctdb 7 for an overview of CTDB. @@ -61,9 +54,6 @@ ctdb.sysconfig 5, - ctdbd.conf - 5, - ctdb 7, diff --git a/ctdb/doc/examples/README b/ctdb/doc/examples/README index fc41d16eb4e..a4ea2228b50 100644 --- a/ctdb/doc/examples/README +++ b/ctdb/doc/examples/README @@ -6,12 +6,6 @@ Sample CTDB configuration files: o 11.natgw.options - Options for the 11.natgw event script o 91.lvs.options - Options for the 91.lvs event script -Sample old-style CTDB cluster configurations - - o cluster.conf - Basic cluster setup - o natgw.conf - Basic cluster setup with NAT gateway feature - o external.conf - Basic cluster setup with externally managed public IP addresses - Sample 60.nfs configuration for NFS ganesha - callout script and .check file diff --git a/ctdb/doc/examples/cluster.conf b/ctdb/doc/examples/cluster.conf deleted file mode 100644 index 2ad9b2b08e3..00000000000 --- a/ctdb/doc/examples/cluster.conf +++ /dev/null @@ -1,87 +0,0 @@ -# -# CTDB configuration for simple cluster -# -# This is the sample configuration for a 3-node CTDB cluster providing file -# services via Samba and NFS. -# -# Cluster details: -# -# internal network (192.168.1.0/24) -# -------+----------------------+-----------------------+---------- -# | | | -# | | | -# eth0 | 192.168.1.1 eth0 | 192.168.1.2 eth0 | 192.168.1.3 -# +-----+-----+ +-----+-----+ +-----+-----+ -# | | | | | | -# | Node 1 | | Node 2 | | Node 3 | -# | | | | | | -# +-----+-----+ +-----+-----+ +-----+-----+ -# eth1 | 10.1.1.1 eth1 | 10.1.1.2 eth1 | 10.1.1.3 -# | | | -# | | | -# -------+----------------------+-----------------------+---------- -# public network (10.1.1.0/24) -# -# -# Storage details: -# -# Each node has a shared storage - /shared -# -# -# Service details: -# -# Cluster provides file services on following IP addresses -# -# 10.1.1.101 - 10.1.1.106 -# -# Each node also has a fixed IP address on public network. This is used to -# communicate to network infrastructure (e.g. DNS, Active Directory, ...). -# Make sure that file services are not available on these fixed IP addresses -# (e.g. network filtering, using cluster hostname instead of IPs) - - -CTDB_RECOVERY_LOCK=/shared/recovery.lock - -# -# Nodes configuration -# -# ---------- /etc/ctdb/nodes ---------- -# 192.168.1.1 -# 192.168.1.2 -# 192.168.1.3 -# ---------- /etc/ctdb/nodes ---------- -# -# -# Public addresses configuration -# -# ---------- /etc/ctdb/public_addresses ---------- -# 10.1.1.101/24 eth1 -# 10.1.1.102/24 eth1 -# 10.1.1.103/24 eth1 -# 10.1.1.104/24 eth1 -# 10.1.1.105/24 eth1 -# 10.1.1.106/24 eth1 -# ---------- /etc/ctdb/public_addresses ---------- -# -# Enable logging to syslog -CTDB_LOGGING=syslog - -# Default log level -CTDB_DEBUGLEVEL=NOTICE - -# Auto start/stop managed services -CTDB_AUTO_STARTSTOP=yes - -# -# Samba configuration -# -CTDB_MANAGES_SAMBA=yes -# CTDB_SAMBA_SKIP_SHARE_CHECK=yes - -CTDB_MANAGES_WINBIND=yes - -# -# NFS configuration -# -CTDB_MANAGES_NFS=yes -CTDB_RPCINFO_LOCALHOST="127.0.0.1" diff --git a/ctdb/doc/examples/lvs.conf b/ctdb/doc/examples/lvs.conf deleted file mode 100644 index e9ade9d5db1..00000000000 --- a/ctdb/doc/examples/lvs.conf +++ /dev/null @@ -1,88 +0,0 @@ -# -# CTDB configuration for simple cluster with LVS -# -# This is the sample configuration for a 3-node CTDB cluster providing file -# services via Samba and NFS. -# -# Cluster details: -# -# internal network (192.168.1.0/24) -# -------+----------------------+-----------------------+---------- -# | | | -# | | | -# eth0 | 192.168.1.1 eth0 | 192.168.1.2 eth0 | 192.168.1.3 -# +-----+-----+ +-----+-----+ +-----+-----+ -# | | | | | | -# | Node 1 | | Node 2 | | Node 3 | -# | | | | | | -# +-----+-----+ +-----+-----+ +-----+-----+ -# eth1 | 10.1.1.1 eth1 | 10.1.1.2 eth1 | 10.1.1.3 -# | | | -# | | | -# -------+----------------------+-----------------------+-----+---- -# public network (10.1.1.0/24) | -# | 10.1.1.254 -# o (router) -# -# Storage details: -# -# Each node has a shared storage - /shared -# -# -# Service details: -# -# Cluster provides file services on single IP address -# -# 10.1.1.101 -# -# Since LVS in CTDB uses direct routing, each node needs to have a static IP -# address on the public network. - - -CTDB_RECOVERY_LOCK=/shared/recovery.lock - -# -# Nodes configuration -# -# ---------- /etc/ctdb/nodes ---------- -# 192.168.1.1 -# 192.168.1.2 -# 192.168.1.3 -# ---------- /etc/ctdb/nodes ---------- -# -# Enable logging to syslog -CTDB_LOGGING=syslog - -# Default log level -CTDB_DEBUGLEVEL=NOTICE - -# Auto start/stop managed services -CTDB_AUTO_STARTSTOP=yes - -# -# Samba configuration -# -CTDB_MANAGES_SAMBA=yes -# CTDB_SAMBA_SKIP_SHARE_CHECK=yes - -CTDB_MANAGES_WINBIND=yes - -# -# NFS configuration -# -CTDB_MANAGES_NFS=yes -CTDB_RPCINFO_LOCALHOST="127.0.0.1" - -# -# LVS configuration -# -# ---------- /etc/ctdb/lvs_nodes ---------- -# 192.168.1.1 -# 192.168.1.2 -# 192.168.1.3 -# ---------- /etc/ctdb/lvs_nodes ---------- -# -CTDB_LVS_NODES=/etc/ctdb/lvs_nodes - -CTDB_LVS_PUBLIC_IP=10.1.1.101 -CTDB_LVS_PUBLIC_IFACE=eth1 diff --git a/ctdb/doc/examples/natgw.conf b/ctdb/doc/examples/natgw.conf deleted file mode 100644 index 5fbb2d16fd4..00000000000 --- a/ctdb/doc/examples/natgw.conf +++ /dev/null @@ -1,104 +0,0 @@ -# -# CTDB configuration for simple cluster with NAT gateway -# -# This is the sample configuration for a 3-node CTDB cluster providing file -# services via Samba and NFS. -# -# Cluster details: -# -# internal network (192.168.1.0/24) -# -------+----------------------+-----------------------+---------- -# | | | -# | | | -# eth0 | 192.168.1.1 eth0 | 192.168.1.2 eth0 | 192.168.1.3 -# +-----+-----+ +-----+-----+ +-----+-----+ -# | | | | | | -# | Node 1 | | Node 2 | | Node 3 | -# | | | | | | -# +-----+-----+ +-----+-----+ +-----+-----+ -# eth1 | eth1 | eth1 | -# | | | -# | | | -# -------+----------------------+-----------------------+-----+---- -# public network (10.1.1.0/24) | -# | 10.1.1.254 -# o (router) -# -# Storage details: -# -# Each node has a shared storage - /shared -# -# -# Service details: -# -# Cluster provides file services on following IP addresses -# -# 10.1.1.101 - 10.1.1.106 -# -# When a node is not hosting any IPs, it cannot connect to network -# infrastructure (e.g. DNS, Active Directory, ...). -# -# Using NAT gateway feature of CTDB allows a node not hosting IPs to connect -# to network infrastructure. - - -CTDB_RECOVERY_LOCK=/shared/recovery.lock - -# -# Nodes configuration -# -# ---------- /etc/ctdb/nodes ---------- -# 192.168.1.1 -# 192.168.1.2 -# 192.168.1.3 -# ---------- /etc/ctdb/nodes ---------- -# -# -# Public addresses configuration -# -# ---------- /etc/ctdb/public_addresses ---------- -# 10.1.1.101/24 eth1 -# 10.1.1.102/24 eth1 -# 10.1.1.103/24 eth1 -# 10.1.1.104/24 eth1 -# 10.1.1.105/24 eth1 -# 10.1.1.106/24 eth1 -# ---------- /etc/ctdb/public_addresses ---------- -# -# Enable logging to syslog -CTDB_LOGGING=syslog - -# Default log level -CTDB_DEBUGLEVEL=NOTICE - -# Auto start/stop managed services -CTDB_AUTO_STARTSTOP=yes - -# -# Samba configuration -# -CTDB_MANAGES_SAMBA=yes -# CTDB_SAMBA_SKIP_SHARE_CHECK=yes - -CTDB_MANAGES_WINBIND=yes - -# -# NFS configuration -# -CTDB_MANAGES_NFS=yes -CTDB_RPCINFO_LOCALHOST="127.0.0.1" - -# -# NAT gateway configuration -# -# ---------- /etc/ctdb/natgw_nodes ---------- -# 192.168.1.1 -# 192.168.1.2 -# 192.168.1.3 -# ---------- /etc/ctdb/natgw_nodes ---------- -# -CTDB_NATGW_PUBLIC_IP=10.1.1.121/24 -CTDB_NATGW_PUBLIC_IFACE=eth1 -CTDB_NATGW_DEFAULT_GATEWAY=10.1.1.254 -CTDB_NATGW_PRIVATE_NETWORK=192.168.1.0/24 -CTDB_NATGW_NODES=/etc/ctdb/natgw_nodes diff --git a/ctdb/packaging/RPM/ctdb.spec.in b/ctdb/packaging/RPM/ctdb.spec.in index 1966ac7e24f..55a0175a774 100644 --- a/ctdb/packaging/RPM/ctdb.spec.in +++ b/ctdb/packaging/RPM/ctdb.spec.in @@ -114,7 +114,6 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sudoers.d DESTDIR=$RPM_BUILD_ROOT ./buildtools/bin/waf install install -m644 config/ctdb.conf $RPM_BUILD_ROOT%{_sysconfdir}/ctdb -install -m644 config/ctdbd.conf $RPM_BUILD_ROOT%{_sysconfdir}/ctdb install -m644 config/ctdb.tunables $RPM_BUILD_ROOT%{_sysconfdir}/ctdb install -m644 config/script.options $RPM_BUILD_ROOT%{_sysconfdir}/ctdb @@ -153,7 +152,6 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root) %config(noreplace) %{_sysconfdir}/ctdb/ctdb.conf -%config(noreplace) %{_sysconfdir}/ctdb/ctdbd.conf %config(noreplace) %{_sysconfdir}/ctdb/ctdb.tunables %config(noreplace) %{_sysconfdir}/ctdb/script.options %{_sysconfdir}/ctdb/notify.sh @@ -213,7 +211,6 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man5/ctdb.conf.5.gz %{_mandir}/man5/ctdb-script.options.5.gz %{_mandir}/man5/ctdb.sysconfig.5.gz -%{_mandir}/man5/ctdbd.conf.5.gz %{_mandir}/man7/ctdb.7.gz %{_mandir}/man7/ctdb-statistics.7.gz %{_mandir}/man7/ctdb-tunables.7.gz diff --git a/ctdb/wscript b/ctdb/wscript index d3b02d6e6fc..22f1b2677cd 100644 --- a/ctdb/wscript +++ b/ctdb/wscript @@ -51,7 +51,6 @@ manpages_misc = [ 'ctdb.conf.5', 'ctdb-script.options.5', 'ctdb.sysconfig.5', - 'ctdbd.conf.5', 'ctdb.7', 'ctdb-statistics.7', 'ctdb-tunables.7', -- 2.34.1