Skip to content

Commit

Permalink
display used space in loop & code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
codefritzel committed May 3, 2023
1 parent f061cb2 commit c61682d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion usr/share/rear/conf/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2182,7 +2182,7 @@ COPY_AS_IS_EXCLUDE_NBKDC=()
REQUIRED_PROGS_NFS4SERVER=("rpc.nfsd" "rpc.mountd" "exportfs" "ss" "nproc")
NFS4SERVER_MODULES=(nfs nfsd)
# List of share options for the recovery system, see 'General Options' in exports(5)
NFS4SERVER_EXPORT_OPTS=("rw" "no_root_squash" "async" "no_subtree_check")
NFS4SERVER_EXPORT_OPTS=(rw no_root_squash async no_subtree_check)
# List of trusted systems that can mount the recovery system, see 'Machine Name Formats' in exports(5)
# e.g. NFS4SERVER_TRUSTED_CLIENTS=( myserver 172.16.76.0/24 )
NFS4SERVER_TRUSTED_CLIENTS=()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# same options works for mountd
local nfsd_opts=(--no-udp --no-nfs-version 3 -V 4.2)
local cpu_cores=$(nproc)
local cpu_cores
cpu_cores=$(nproc) || Error "Could not determine CPU details via nproc"
# 4 threads per cpu core
local nfs_threads=$(( $cpu_cores * 4 ))
# 8 are the standard and should be the minumun
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ LogPrint "Wait until $check_file was created and there is no connection on the N
# or look at /var/lib/nfs/rmtab
local nfs_connections=1
while [ ! -f "$check_file" ] || [ "$nfs_connections" -gt 0 ]; do
local available_size
available_size=$(df --total --local -h --exclude-type=tmpfs --exclude-type=devtmpf | tail -n 1 | awk '{print $3}') &&
ProgressInfo " Used storage space: $available_size"

sleep 5
nfs_connections=$(ss -tanpH state established "( sport = 2049 )" | wc -l)
done
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 400_verify_nfs_server.sh

# Check if at least one trusted client was specified
(( "${#NFS4SERVER_TRUSTED_CLIENTS[@]}" > 0 )) || Error "You must have defined at least one client in NFS4SERVER_TRUSTED_CLIENTS."

0 comments on commit c61682d

Please sign in to comment.