NFS not mounting selinux denied ganesha nfsd
Issue:
[root@nfs02 ~]# systemctl restart nfs-ganesha
[root@nfs02 ~]# tail -f /var/log/audit/audit.log|grep -Ei denied
type=AVC msg=audit(1751218637.762:445): avc: denied { module_request } for pid=9185 comm=”ganesha.nfsd” kmod=”net-pf-10″ scontext=system_u:system_r:ganesha_t:s0 tcontex t=system_u:system_r:kernel_t:s0 tclass=system permissive=0
type=AVC msg=audit(1751218637.790:446): avc: denied { module_request } for pid=9185 comm=”ganesha.nfsd” kmod=”net-pf-10″ scontext=system_u:system_r:ganesha_t:s0 tcontex t=system_u:system_r:kernel_t:s0 tclass=system permissive=0
type=AVC msg=audit(1751218639.131:447): avc: denied { module_request } for pid=9221 comm=”lpqd” kmod=”net-pf-10″ scontext=system_u:system_r:smbd_t:s0 tcontext=system_u: system_r:kernel_t:s0 tclass=system permissive=0
type=AVC msg=audit(1751218684.282:448): avc: denied { module_request } for pid=1256 comm=”zabbix_agentd” kmod=”net-pf-10″ scontext=system_u:system_r:zabbix_agent_t:s0 t context=system_u:system_r:kernel_t:s0 tclass=system permissive=0
type=AVC msg=audit(1751218804.322:456): avc: denied { module_request } for pid=1256 comm=”zabbix_agentd” kmod=”net-pf-10″ scontext=system_u:system_r:zabbix_agent_t:s0 t context=system_u:system_r:kernel_t:s0 tclass=system permissive=0
type=AVC msg=audit(1751218924.363:457): avc: denied { module_request } for pid=1256 comm=”zabbix_agentd” kmod=”net-pf-10″ scontext=system_u:system_r:zabbix_agent_t:s0 t context=system_u:system_r:kernel_t:s0 tclass=system permissive=0
type=AVC msg=audit(1751219044.406:458): avc: denied { module_request } for pid=1256 comm=”zabbix_agentd” kmod=”net-pf-10″ scontext=system_u:system_r:zabbix_agent_t:s0 t context=system_u:system_r:kernel_t:s0 tclass=system permissive=0
^C
Fix:
[root@nfs02 ~]# ausearch -m avc -c ganesha.nfsd –raw | audit2allow -m ganesha_local | tee -a ganesha_local.te
module ganesha_local 1.0;
require {
type kernel_t;
type ganesha_t;
class system module_request;
}
#============= ganesha_t ==============
#!!!! This avc can be allowed using the boolean ‘domain_kernel_load_modules’
allow ganesha_t kernel_t:system module_request;
[root@nfs02 ~]# setsebool -P domain_kernel_load_modules on
[root@nfs02 ~]# checkmodule -M -m -o ganesha_local.mod ganesha_local.te
checkmodule: loading policy configuration from ganesha_local.te
checkmodule: policy configuration loaded
checkmodule: writing binary representation (version 19) to ganesha_local.mod
[root@nfs02 ~]# semodule_package -o ganesha_local.pp -m ganesha_local.mod
[root@nfs02 ~]# sudo semodule -i ganesha_local.pp
libsemanage.add_user: user ipauser not in password file
[root@nfs02 ~]#
[root@nfs02 ~]#
[root@nfs02 ~]# tail -f /var/log/audit/audit.log|grep -Ei denied
Also, for this error:
[root@nfs01 ganesha]# cat ganesha-rgw.log
29/06/2025 13:30:18 : epoch 6861782a : nfs01.nix.mds.xyz : ganesha.nfsd-8233[main] nfs_start_grace :STATE :EVENT :NFS Server Now IN GRACE, duration 90
29/06/2025 13:30:18 : epoch 6861782a : nfs01.nix.mds.xyz : ganesha.nfsd-8233[main] glusterfs_create_export :FSAL :EVENT :Volume gv01 exported at : ‘/’
29/06/2025 13:30:19 : epoch 6861782a : nfs01.nix.mds.xyz : ganesha.nfsd-8233[main] glusterfs_get_fs :FSAL :CRIT :Unable to initialize volume. Volume: gv01
29/06/2025 13:30:20 : epoch 6861782a : nfs01.nix.mds.xyz : ganesha.nfsd-8233[main] mdcache_fsal_create_export :FSAL :MAJ :Failed to call create_export on underlying FSAL GLUSTER
29/06/2025 13:30:20 : epoch 6861782a : nfs01.nix.mds.xyz : ganesha.nfsd-8233[main] fsal_cfg_commit :CONFIG :CRIT :Could not create export for (/n) to (/n)
29/06/2025 13:30:20 : epoch 6861782a : nfs01.nix.mds.xyz : ganesha.nfsd-8233[main] main :NFS STARTUP :WARN :No export entries found in configuration file !!!
29/06/2025 13:30:20 : epoch 6861782a : nfs01.nix.mds.xyz : ganesha.nfsd-8233[main] config_errs_to_log :CONFIG :CRIT :Config File (/etc/ganesha/export.conf:12): 1 validation errors in block FSAL
Don’t restart NFS-Ganesha too quickly after Glusterd. Give it a second or two:
systemctl restart keepalived glusterd -l; sleep 15; systemctl restart nfs-ganesha -l
HIH!
Cheers,
TK

