I think the problem is that you are trying to provide the export block in the dbus command when what the dbus command specifies is a file (on the Ganesha server node) that contains the export block to be added, and an expression to indicate which export block in that file to use to add from. I played with this at one time, but I don't seem to have kept notes on exactly what I did. Perhaps someone more familiar with the add export dbus interface could give more help. Optionally, another way to add exports it to edit the config file that is used at start up and then send SIGHUP to the ganesha.nfsd process. Ganesha will then re-read the config file (in it's entirety) and process LOG, EXPORT, and EXPORT_DEFAULTS blocks. It will add new exports and update existing ones. If an export is no longer in the config file, it will be removed (depending on the specifics, that may cause problems, but in simple configurations it should work). Frank
-----Original Message----- From: roshandkolhe@gmail.com [mailto:roshandkolhe@gmail.com] Sent: Thursday, June 11, 2020 11:24 AM To: support@lists.nfs-ganesha.org Subject: [NFS-Ganesha-Support] dbus-send AddExport is failing with "Error org.freedesktop.DBus.Error.InvalidArgs: Error finding exports: EXPORT(Export_Id=3, ...).FSAL(Name="VFS") because No such file or directory"
Hi, I am exploring dynamic export in NFS-Ganesha using dbus-send. I could compile NFS-Ganesha with "USE_DBUS=ON" and could also start the ganesha.nfsd. The exports which were present in my config file are properly up when I started ganesha.nfsd. But, I am not able to add any new export. dbus-send command is always failing with below error
[root@localhost ~]# ls -lrt /home/ total 0 drwxr-xr-x. 3 root root 36 Jun 2 21:22 ganesha_nfs_v3 drwxr-xr-x. 2 root root 6 Jun 10 18:18 ganesha_1 drwxr-xr-x. 8 root root 199 Jun 11 15:00 ganesha_nfs_v4
[root@localhost ~]# sudo dbus-send --print-reply --system -- dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.AddExport string:/etc/ganesha/export.conf 'string:EXPORT(Export_Id=3, Path="/home/ganesha_1/", Pseudo="/home/ganesha_1/", Transports="TCP").FSAL(Name="VFS")' Error org.freedesktop.DBus.Error.InvalidArgs: Error finding exports: EXPORT(Export_Id=3, Path="/home/ganesha_1/", Pseudo="/home/ganesha_1/", Transports="TCP").FSAL(Name="VFS") because No such file or directory [root@localhost ~]#
Messages in "/var/log/ganesha.log": 11/06/2020 23:44:23 : epoch 5ee2736e : localhost.localdomain : ganesha.nfsd- 26823[dbus_heartbeat] gsh_export_addexport :EXPORT :CRIT :Error finding exports: EXPORT(Export_Id=3, Path="/home/ganesha_1/", Pseudo="/home/ganesha_1/", Transports="TCP").FSAL(Name="VFS") because No such file or directory 11/06/2020 23:44:23 : epoch 5ee2736e : localhost.localdomain : ganesha.nfsd- 26823[dbus_heartbeat] dbus_message_entrypoint :DBUS :MAJ :Method (AddExport) on (org.ganesha.nfsd.exportmgr) failed: name = (org.freedesktop.DBus.Error.InvalidArgs), message = (Error finding exports: EXPORT(Export_Id=3, Path="/home/ganesha_1/", Pseudo="/home/ganesha_1/", Transports="TCP").FSAL(Name="VFS") because No such file or directory) 11/06/2020 23:46:06 : epoch 5ee2736e : localhost.localdomain : ganesha.nfsd- 26823[dbus_heartbeat] nfs_health :DBUS :WARN :Health status is unhealthy. enq new: 5445, old: 5441; deq new: 5441, old: 5441
Can someone please help on this?
I have followed the steps mentioned in: https://github.com/nfs-ganesha/nfs- ganesha/wiki/Dbusinterface
[root@localhost ~]# ps -ef | grep nfs root 26823 1 0 23:39 ? 00:00:00 /root/build_dir_v3_stable/ganesha.nfsd -f /etc/ganesha/ganesha.conf root 26854 25589 0 23:39 pts/1 00:00:00 grep --color=auto nfs [root@localhost ~]# cat /var/log/ganesha.log | grep dbus 11/06/2020 23:39:50 : epoch 5ee2736e : localhost.localdomain : ganesha.nfsd- 26823[main] nfs_Start_threads :THREAD :EVENT :gsh_dbusthread was started successfully [root@localhost ~]# showmount -e Export list for localhost.localdomain: /home/ganesha_nfs_v3 (everyone) /home/ganesha_nfs_v4 (everyone) [root@localhost ~]#
[root@localhost ~]# cat /etc/ganesha/ganesha.conf ## These are core parameters that affect Ganesha as a whole. NFS_CORE_PARAM { ## Configure the protocols that Ganesha will listen for. This is a hard ## limit, as this list determines which sockets are opened. This list ## can be restricted per export, but cannot be expanded. Protocols = 3, 4;
# Enable NLM (network lock manager protocol) Enable_NLM = false;
# lockmgr port NLM_PORT = 45075;
Enable_RQUOTA = false; }
## These are defaults for exports. They can be overridden per-export. EXPORT_DEFAULTS { ## Restrict the protocols that may use this export. This cannot allow ## access that is denied in NFS_CORE_PARAM. Protocols = 3, 4;
## Access type for clients. Default is None, so some access must be ## given either here or in the export itself. Access_Type = RW;
## Whether to squash various users. Squash = No_Root_Squash;
## Allowed security types for this export Sectype = sys,krb5,krb5i,krb5p; }
## Configure settings for the object handle cache MDCACHE { ## The point at which object cache entries will start being reused. Entries_HWMark = 100000; }
## Configure logging. Default is to log to Syslog. Basic logging can also be ## configured from the command line LOG { ## Default log level for all components Default_Log_Level = EVENT; #Default_Log_Level = DEBUG;
## Configure per-component log levels. Components { FSAL = INFO; NFS4 = EVENT; NFS3 = EVENT; }
## Where to log Facility { name = FILE; destination = "/var/log/ganesha.log"; enable = active; } }
NFS_KRB5 { Active_krb5 = false; }
%include "/etc/ganesha/export.conf"
[root@localhost ~]# cat /etc/ganesha/export.conf ## Configure an export for some file tree EXPORT { ## Export Id (mandatory, each EXPORT must have a unique Export_Id) Export_Id = 1;
## Exported path (mandatory) Path = /home/ganesha_nfs_v3/;
## Pseudo Path (required for NFSv4 or if mount_path_pseudo = true) Pseudo = /home/ganesha_nfs_v3/;
Transports = "TCP";
## Exporting FSAL FSAL { Name = VFS; } }
EXPORT { ## Export Id (mandatory, each EXPORT must have a unique Export_Id) Export_Id = 2;
## Exported path (mandatory) Path = /home/ganesha_nfs_v4/;
## Pseudo Path (required for NFSv4 or if mount_path_pseudo = true) Pseudo = /home/ganesha_nfs_v4/;
Transports = "TCP";
## Exporting FSAL FSAL { Name = VFS; } }
Just as a data point, DisplayExport and ShowExports are running fine.
[root@localhost ~]# dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.DisplayExport uint16:1 method return time=1591899610.781101 sender=:1.175 -> destination=:1.178 serial=623 reply_serial=2 uint16 1 string "/home/ganesha_nfs_v3" string "/home/ganesha_nfs_v3" string "" array [ ] [root@localhost ~]# dbus-send --print-reply --system --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.ShowExports method return time=1591899620.339869 sender=:1.175 -> destination=:1.179 serial=633 reply_serial=2 struct { uint64 1591898990 uint64 170367428 } array [ struct { uint16 1 string "/home/ganesha_nfs_v3" boolean true boolean false boolean false boolean false boolean false boolean false boolean false boolean false struct { uint64 1591899616 uint64 118026535 } } struct { uint16 2 string "/home/ganesha_nfs_v4" boolean false boolean false boolean false boolean false boolean false boolean true boolean false boolean false struct { uint64 1591899006 uint64 449489142 } } struct { uint16 0 string "/" boolean false boolean false boolean false boolean false boolean false boolean false boolean false boolean false struct { uint64 1591898990 uint64 143657141 } } ] [root@localhost ~]# _______________________________________________ Support mailing list -- support@lists.nfs-ganesha.org To unsubscribe send an email to support-leave@lists.nfs-ganesha.org