@@ -197,32 +197,32 @@ stop() {
197
197
# ## runtime environment detection
198
198
# #####################################################################################
199
199
200
- get_reqd_nfs_version () {
200
+ get_requested_nfs_version () {
201
201
202
202
echo " ${! ENV_VAR_NFS_VERSION:- $DEFAULT_NFS_VERSION } "
203
203
}
204
204
205
- get_reqd_nfsd_threads () {
205
+ get_requested_count_nfsd_threads () {
206
206
207
207
echo " ${! ENV_VAR_NFS_SERVER_THREAD_COUNT:- $DEFAULT_NFS_SERVER_THREAD_COUNT } "
208
208
}
209
209
210
- get_reqd_mountd_port () {
210
+ get_requested_port_mountd () {
211
211
212
212
echo " ${! ENV_VAR_NFS_PORT_MOUNTD:- $DEFAULT_NFS_PORT_MOUNTD } "
213
213
}
214
214
215
- get_reqd_nfsd_port () {
215
+ get_requested_port_nfsd () {
216
216
217
217
echo " ${! ENV_VAR_NFS_PORT:- $DEFAULT_NFS_PORT } "
218
218
}
219
219
220
- get_reqd_statd_in_port () {
220
+ get_requested_port_statd_in () {
221
221
222
222
echo " ${! ENV_VAR_NFS_PORT_STATD_IN:- $DEFAULT_NFS_PORT_STATD_IN } "
223
223
}
224
224
225
- get_reqd_statd_out_port () {
225
+ get_requested_port_statd_out () {
226
226
227
227
echo " ${! ENV_VAR_NFS_PORT_STATD_OUT:- $DEFAULT_NFS_PORT_STATD_OUT } "
228
228
}
@@ -276,17 +276,19 @@ assert_port() {
276
276
277
277
assert_nfs_version () {
278
278
279
- get_reqd_nfs_version | grep -Eq ' ^(3|4|4\.1|4\.2)$'
279
+ local -r version=" $( get_requested_nfs_version) "
280
+
281
+ echo " $version " | grep -Eq ' ^(3|4|4\.1|4\.2)$'
280
282
on_failure bail " please set $ENV_VAR_NFS_VERSION to one of: 4.2, 4.1, 4, 3"
281
283
282
- if [[ -z " $( is_nfs3_enabled) " && " $( get_reqd_nfs_version ) " = = ' 3' ]]; then
284
+ if [[ -z " $( is_nfs3_enabled) " && " $version " = ' 3' ]]; then
283
285
bail ' you cannot simultaneously enable and disable NFS version 3'
284
286
fi
285
287
}
286
288
287
289
assert_nfsd_threads () {
288
290
289
- local -r reqd_thread_count=$( get_reqd_nfsd_threads )
291
+ local -r reqd_thread_count=$( get_requested_count_nfsd_threads )
290
292
291
293
if [[ " $reqd_thread_count " -lt 1 ]]; then
292
294
bail " please set $ENV_VAR_NFS_SERVER_THREAD_COUNT to a positive integer"
@@ -433,14 +435,14 @@ boot_helper_mount() {
433
435
434
436
boot_helper_get_version_flags () {
435
437
436
- local -r reqd_version=" $( get_reqd_nfs_version ) "
438
+ local -r reqd_version=" $( get_requested_nfs_version ) "
437
439
local flags=(' --nfs-version' " $reqd_version " ' --no-nfs-version' 2)
438
440
439
441
if [[ -z " $( is_nfs3_enabled) " ]]; then
440
442
flags+=(' --no-nfs-version' 3)
441
443
fi
442
444
443
- if [[ " $reqd_version " == ' 3' ]]; then
445
+ if [[ " $reqd_version " = ' 3' ]]; then
444
446
flags+=(' --no-nfs-version' 4)
445
447
fi
446
448
@@ -470,7 +472,7 @@ boot_main_mountd() {
470
472
471
473
local version_flags
472
474
read -r -a version_flags <<< " $(boot_helper_get_version_flags)"
473
- local -r port=$( get_reqd_mountd_port )
475
+ local -r port=$( get_requested_port_mountd )
474
476
local -r args=(' --debug' ' all' ' --port' " $port " " ${version_flags[@]} " )
475
477
476
478
# yes, rpc.mountd is required even for NFS v4: https://forums.gentoo.org/viewtopic-p-7724856.html#7724856
@@ -491,7 +493,7 @@ boot_main_rpcbind() {
491
493
492
494
boot_main_idmapd () {
493
495
494
- if [[ " $( get_reqd_nfs_version ) " != ' 3' && -f " $PATH_FILE_ETC_IDMAPD_CONF " ]]; then
496
+ if [[ " $( get_requested_nfs_version ) " != ' 3' && -f " $PATH_FILE_ETC_IDMAPD_CONF " ]]; then
495
497
log ' starting idmapd'
496
498
$PATH_BIN_IDMAPD -v -S
497
499
on_failure stop ' idmapd failed'
@@ -504,8 +506,8 @@ boot_main_statd() {
504
506
return
505
507
fi
506
508
507
- local -r port_in=$( get_reqd_statd_in_port )
508
- local -r port_out=$( get_reqd_statd_out_port )
509
+ local -r port_in=$( get_requested_port_statd_in )
510
+ local -r port_out=$( get_requested_port_statd_out )
509
511
local -r args=(' --no-notify' ' --port' " $port_in " ' --outgoing-port' " $port_out " )
510
512
511
513
log " starting statd on port $port_in (outgoing connections from port $port_out )"
@@ -517,8 +519,8 @@ boot_main_nfsd() {
517
519
518
520
local version_flags
519
521
read -r -a version_flags <<< " $(boot_helper_get_version_flags)"
520
- local -r threads=$( get_reqd_nfsd_threads )
521
- local -r port=$( get_reqd_nfsd_port )
522
+ local -r threads=$( get_requested_count_nfsd_threads )
523
+ local -r port=$( get_requested_port_nfsd )
522
524
local -r args=(' --debug' 8 ' --port' " $port " " ${version_flags[@]} " " $threads " )
523
525
524
526
log " starting rpc.nfsd on port $port with $threads server thread(s)"
@@ -548,7 +550,7 @@ boot_main_svcgssd() {
548
550
549
551
summarize_nfs_versions () {
550
552
551
- local -r reqd_version=" $( get_reqd_nfs_version ) "
553
+ local -r reqd_version=" $( get_requested_nfs_version ) "
552
554
local versions=' '
553
555
554
556
case " $reqd_version " in
@@ -592,16 +594,18 @@ summarize_exports() {
592
594
593
595
summarize_ports () {
594
596
595
- local -r port_nfsd=" $( get_reqd_nfsd_port) "
597
+ local -r port_nfsd=" $( get_requested_port_nfsd) "
598
+ local -r port_mountd=" $( get_requested_port_mountd) "
599
+ local -r port_statd_in=" $( get_requested_port_statd_in) "
596
600
597
601
if [[ -z " $( is_nfs3_enabled) " ]]; then
598
602
log " list of container ports that should be exposed: $port_nfsd (TCP)"
599
603
else
600
604
log ' list of container ports that should be exposed:'
601
605
log ' 111 (TCP and UDP)'
602
606
log " $port_nfsd (TCP and UDP)"
603
- log " $( get_reqd_statd_in_port ) (TCP and UDP)"
604
- log " $( get_reqd_mountd_port ) (TCP and UDP)"
607
+ log " $port_statd_in (TCP and UDP)"
608
+ log " $port_mountd (TCP and UDP)"
605
609
fi
606
610
}
607
611
0 commit comments