diff options
author | Martin Schwenke <martin@meltin.net> | 2019-03-26 14:49:49 +1100 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2019-03-31 10:45:20 +0000 |
commit | e72c3c800a50fe746164e319e21180c44d041619 (patch) | |
tree | a5fa5fca37a7090d5eaeab40e033c100d70c52a5 /ctdb | |
parent | 9981353ab79dce81b698c535977be4a681119d1e (diff) | |
download | samba-e72c3c800a50fe746164e319e21180c44d041619.tar.gz |
ctdb-scripts: Add test variable CTDB_NFS_DISTRO_STYLE
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@samba.org>
Diffstat (limited to 'ctdb')
-rwxr-xr-x | ctdb/config/nfs-linux-kernel-callout | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/ctdb/config/nfs-linux-kernel-callout b/ctdb/config/nfs-linux-kernel-callout index 73623d87875..bd534c41a32 100755 --- a/ctdb/config/nfs-linux-kernel-callout +++ b/ctdb/config/nfs-linux-kernel-callout @@ -12,20 +12,38 @@ set -e # hook for testing. nfs_exports_file="${CTDB_NFS_EXPORTS_FILE:-/var/lib/nfs/etab}" -# Red Hat -nfs_service="nfs" -nfs_lock_service="nfslock" -nfs_config="/etc/sysconfig/nfs" - -# SUSE -#nfs_service="nfsserver" -#nfs_lock_service="" -#nfs_config="/etc/sysconfig/nfs" - -# Debian -#nfs_service="nfs-kernel-server" -#nfs_lock_service="" -#nfs_config="/etc/default/nfs-kernel-server" +# As above, edit the default value below. CTDB_NFS_DISTRO_STYLE is a +# test variable only. +nfs_distro_style="${CTDB_NFS_DISTRO_STYLE:-sysvinit-redhat}" + +case "$nfs_distro_style" in +sysvinit-*) + # Defaults + nfs_service="nfs" + nfs_lock_service="" + nfs_config="/etc/sysconfig/nfs" + + case "$nfs_distro_style" in + *-redhat) + nfs_lock_service="nfslock" + ;; + *-suse) + nfs_service="nfsserver" + ;; + *-debian) + nfs_service="nfs-kernel-server" + nfs_config="/etc/default/nfs-kernel-server" + ;; + *) + echo "Internal error" + exit 1 + esac + ;; + +*) + echo "Internal error" + exit 1 +esac # Override for unit testing if [ -z "$PROCFS_PATH" ] ; then |