Skip to content

Commit

Permalink
ctdb-scripts: Add test variable CTDB_NFS_DISTRO_STYLE
Browse files Browse the repository at this point in the history
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860

Signed-off-by: Martin Schwenke <[email protected]>
Reviewed-by: Amitay Isaacs <[email protected]>
  • Loading branch information
martin-schwenke authored and Martin Schwenke committed Mar 31, 2019
1 parent 9981353 commit e72c3c8
Showing 1 changed file with 32 additions and 14 deletions.
46 changes: 32 additions & 14 deletions ctdb/config/nfs-linux-kernel-callout
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e72c3c8

Please sign in to comment.