@@ -606,6 +606,11 @@ boot_main_exportfs() {
606
606
607
607
boot_main_mountd () {
608
608
609
+ # https://linux.die.net/man/8/rpc.mountd
610
+ #
611
+ # --debug turn on debugging. Valid kinds are: all, auth, call, general and parse.
612
+ # --port specifies the port number used for RPC listener sockets
613
+
609
614
local version_flags
610
615
read -r -a version_flags <<< " $(boot_helper_get_version_flags)"
611
616
local -r port=" ${state[$STATE_MOUNTD_PORT]} "
@@ -620,10 +625,19 @@ boot_main_mountd() {
620
625
621
626
boot_main_rpcbind () {
622
627
623
- # rpcbind isn't required for NFSv4, but if it's not running then nfsd takes over 5 minutes to start up.
624
- # it's a bug in either nfs-utils or the kernel, and the code of both is over my head.
625
- # so as a workaround we start rpcbind now and (in v4-only scenarios) kill it after nfsd starts up
626
- local -r args=(' -ds' )
628
+ # https://linux.die.net/man/8/rpcbind
629
+ #
630
+ # -d run in debug mode. in this mode, rpcbind will not fork when it starts, will print additional information during
631
+ # operation, and will abort on certain errors if -a is also specified. with this option, the name-to-address
632
+ # translation consistency checks are shown in detail
633
+ # -s cause rpcbind to change to the user daemon as soon as possible. this causes rpcbind to use non-privileged ports
634
+ # for outgoing connections, preventing non-privileged clients from using rpcbind to connect to services from a
635
+ # privileged port
636
+
637
+ local args=(' -s' )
638
+ if is_logging_debug; then
639
+ arg+=(' -d' )
640
+ fi
627
641
boot_helper_start_daemon ' starting rpcbind' $PATH_BIN_RPCBIND " ${args[@]} "
628
642
}
629
643
@@ -633,6 +647,12 @@ boot_main_idmapd() {
633
647
return
634
648
fi
635
649
650
+ # https://linux.die.net/man/8/rpc.idmapd
651
+ #
652
+ # -S Server-only: perform no idmapping for any NFS client, even if one is detected
653
+ # -v increases the verbosity level (can be specified multiple times
654
+ # -f runs rpc.idmapd in the foreground and prints all output to the terminal
655
+
636
656
local args=(' -S' )
637
657
local func=boot_helper_start_daemon
638
658
if is_logging_debug; then
@@ -649,15 +669,44 @@ boot_main_statd() {
649
669
return
650
670
fi
651
671
672
+ # https://linux.die.net/man/8/rpc.statd
673
+ #
674
+ # --no-syslog causes rpc.statd to write log messages on stderr instead of to the system log, if the -F option was
675
+ # also specified
676
+ # --foreground keeps rpc.statd attached to its controlling terminal so that NSM operation can be monitored
677
+ # directly or run under a debugger. if this option is not specified, rpc.statd backgrounds itself
678
+ # soon after it starts
679
+ # --no-notify prevents rpc.statd from running the sm-notify command when it starts up, preserving the existing
680
+ # NSM state number and monitor list
681
+ # --outgoing-port specifies the source port number the sm-notify command should use when sending reboot notifications
682
+ # --port specifies the port number used for RPC listener sockets
683
+
652
684
local -r port_in=" ${state[$STATE_STATD_PORT_IN]} "
653
685
local -r port_out=" ${state[$STATE_STATD_PORT_OUT]} "
654
- local -r args=(' --no-notify' ' --port' " $port_in " ' --outgoing-port' " $port_out " )
686
+ local args=(' --no-notify' ' --port' " $port_in " ' --outgoing-port' " $port_out " )
687
+ local func=boot_helper_start_daemon
655
688
656
- boot_helper_start_daemon " starting statd on port $port_in (outgoing from port $port_out )" $PATH_BIN_STATD " ${args[@]} "
689
+ if is_logging_debug; then
690
+ args+=(' --no-syslog' ' --foreground' )
691
+ func=boot_helper_start_non_daemon
692
+ fi
693
+
694
+ $func " starting statd on port $port_in (outgoing from port $port_out )" $PATH_BIN_STATD " ${args[@]} "
657
695
}
658
696
659
697
boot_main_nfsd () {
660
698
699
+ # https://linux.die.net/man/8/rpc.nfsd
700
+ #
701
+ # --debug enable logging of debugging messages
702
+ # --port specify a diferent port to listen on for NFS requests. by default, rpc.nfsd will listen on port 2049
703
+ # --tcp explicitly enable TCP connections from clients
704
+ # --udp explicitly enable UCP connections from clients
705
+ # nproc specify the number of NFS server threads. by default, just one thread is started. however, for optimum
706
+ # performance several threads should be used. the actual figure depends on the number of and the work load
707
+ # created by the NFS clients, but a useful starting point is 8 threads. effects of modifying that number can
708
+ # be checked using the nfsstat(8) program
709
+
661
710
local version_flags
662
711
read -r -a version_flags <<< " $(boot_helper_get_version_flags)"
663
712
local -r threads=" ${state[$STATE_NFSD_THREAD_COUNT]} "
@@ -670,6 +719,9 @@ boot_main_nfsd() {
670
719
671
720
boot_helper_start_daemon " starting rpc.nfsd on port $port with $threads server thread(s)" $PATH_BIN_NFSD " ${args[@]} "
672
721
722
+ # rpcbind isn't required for NFSv4, but if it's not running then nfsd takes over 5 minutes to start up.
723
+ # it's a bug in either nfs-utils or the kernel, and the code of both is over my head.
724
+ # so as a workaround we start rpcbind always and (in v4-only scenarios) kill it after nfsd starts up
673
725
if ! is_nfs3_enabled; then
674
726
term_process " $PATH_BIN_RPCBIND "
675
727
fi
@@ -681,9 +733,18 @@ boot_main_svcgssd() {
681
733
return
682
734
fi
683
735
736
+ # https://linux.die.net/man/8/rpc.svcgssd
737
+ #
738
+ # -f runs rpc.svcgssd in the foreground and sends output to stderr (as opposed to syslogd)
739
+ # -v increases the verbosity of the output (can be specified multiple times)
740
+ # -r if the rpcsec_gss library supports setting debug level, increases the verbosity of the output (can be specified
741
+ # multiple times)
742
+ # -i if the nfsidmap library supports setting debug level, increases the verbosity of the output (can be specified
743
+ # multiple times)
744
+
684
745
local args=(' -f' )
685
746
if is_logging_debug; then
686
- args+=(' -vvv' )
747
+ args+=(' -vvv' ' -rrr ' ' -iii ' )
687
748
fi
688
749
689
750
boot_helper_start_non_daemon ' starting rpc.svcgssd' $PATH_BIN_RPC_SVCGSSD " ${args[@]} "
0 commit comments