From: Martin Schwenke Date: Thu, 19 Apr 2018 11:54:11 +0000 (+1000) Subject: ctdb-scripts: Drop support for CTDB_DBDIR=tmpfs X-Git-Tag: ldb-1.4.0~471 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=043f3f266a988dadbf2992800c198af6c4bc0569;p=thirdparty%2Fsamba.git ctdb-scripts: Drop support for CTDB_DBDIR=tmpfs CTDB has no business mounting filesystems. Instead, documentation for the new configuration system will include a recommendation that a tmpfs be mounted on the volatile database directory. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/config/ctdbd_wrapper b/ctdb/config/ctdbd_wrapper index 6473a3eddd6..320e02cf078 100755 --- a/ctdb/config/ctdbd_wrapper +++ b/ctdb/config/ctdbd_wrapper @@ -26,39 +26,6 @@ ctdbd="${CTDBD:-/usr/local/sbin/ctdbd}" ############################################################ -# If necessary, mount volatile database directory on tmpfs -dbdir_tmpfs_start () -{ - if [ -z "$CTDB_DBDIR_TMPFS_OPTIONS" ] ; then - return - fi - - # Shortcut for readability - _opts="$CTDB_DBDIR_TMPFS_OPTIONS" - - mkdir -p "$CTDB_DBDIR" || exit $? - - # If already mounted then remount, otherwise mount - if findmnt -t tmpfs "$CTDB_DBDIR" >/dev/null ; then - mount -t tmpfs -o "remount,$_opts" none "$CTDB_DBDIR" || \ - exit $? - else - mount -t tmpfs -o "$_opts" none "$CTDB_DBDIR" || exit $? - fi -} - -# If necessary, unmount volatile database tmpfs directory on exit -dbdir_tmpfs_stop () -{ - if [ -z "$CTDB_DBDIR_TMPFS_OPTIONS" ] ; then - return - fi - - if [ -d "$CTDB_DBDIR" ] && findmnt -t tmpfs "$CTDB_DBDIR" >/dev/null ; then - umount "$CTDB_DBDIR" - fi -} - # Only the nested function references its arguments # shellcheck disable=SC2120 build_ctdb_options () @@ -115,8 +82,6 @@ export_debug_variables () start() { - dbdir_tmpfs_start - # build_ctdb_options() takes no arguments # shellcheck disable=SC2119 build_ctdb_options @@ -171,8 +136,6 @@ stop() return 1 fi - dbdir_tmpfs_stop - return 0 } diff --git a/ctdb/doc/ctdbd.conf.5.xml b/ctdb/doc/ctdbd.conf.5.xml index 3452f84047e..dc530749b2c 100644 --- a/ctdb/doc/ctdbd.conf.5.xml +++ b/ctdb/doc/ctdbd.conf.5.xml @@ -142,17 +142,6 @@ Defaults to /usr/local/var/lib/ctdb/volatile. - - Apart from a DIRECTORY, this can take a special value of - the form - :OPTIONS. - OPTIONS is a comma-separated list of any permissible - options to the tmpfs filesystem. The only pre-specified - default is , which can - overridden by specifying in - OPTIONS. It probably makes sense to specify a maximum - . - Corresponds to .