I started sharing out zfs filesystems via NFS last week using sharenfs=on. That seems to work fine until I reboot. Turned out the NFS server wasn''t enabled - I had to enable nfs/server, nfs/lockmgr and nfs/status manually. This is a stock SXCR b49 (ZFS root) install - don''t think I''d changed anything much. Shouldn''t a ZFS share be permanently enabling NFS? -- Rasputin :: Jack of All Trades - Master of Nuns http://number9.hellooperator.net/
On Tue, Oct 24, 2006 at 08:01:21PM +0100, Dick Davies wrote:> I started sharing out zfs filesystems via NFS last week using > sharenfs=on. That seems to work fine until I reboot. Turned > out the NFS server wasn''t enabled - I had to enable > nfs/server, nfs/lockmgr and nfs/status manually. This is a stock > SXCR b49 (ZFS root) install - don''t think I''d changed anything much. > > Shouldn''t a ZFS share be permanently enabling NFS?By default, NFS servers are configured with ''auto-start'' behavior. So, if you look at the services when nothing is shared, you''ll see: # svcs -l nfs/server fmri svc:/network/nfs/server:default name NFS server enabled false (temporary) state disabled next_state none state_time Wed Oct 11 13:48:08 2006 logfile /var/svc/log/network-nfs-server:default.log restarter svc:/system/svc/restarter:default contract_id dependency require_any/error svc:/milestone/network (online) dependency require_all/error svc:/network/nfs/nlockmgr (online) dependency optional_all/error svc:/network/nfs/mapid (online) dependency require_all/restart svc:/network/rpc/bind (online) dependency optional_all/none svc:/network/rpc/keyserv (disabled) dependency optional_all/none svc:/network/rpc/gss (online) dependency require_all/error svc:/system/filesystem/local (online) However, these services have a special ''auto_enabled'' boolean property: # svcprop -p application/auto_enable nfs/server true This property indicates that regardless of the current state of nfs/server, if you invoke share(1M) (either manually or through ''zfs share -a''), then the server will be automatically started. By default, the system should have been in this state, with nfs/server enabled but temporarily disabled. Did you explicity ''svcadm disable nfs/server'' beforehand? It may be that the start method (which contains the ''zfs share -a'' invocation) will not run, and the auto-enable behavior will not be triggered. However, an explicit invocation of share(1M) will always trigger the server to be started, unles you turn off the ''auto_enabled'' property. ZFS certainly could do the equivalent of a ''svcadm enable nfs/server'', but it shouldn''t need to, nor is it clear that ZFS should do anything different than if you had placed something into /etc/dfs/dfstab. I''d like to understand how exactly this happened, though. This may also overlap with a (soon to be completed) rewrite of how shares are managed and tracked in Solaris. - Eric -- Eric Schrock, Solaris Kernel Development http://blogs.sun.com/eschrock
On 24/10/06, Eric Schrock <eric.schrock at sun.com> wrote:> On Tue, Oct 24, 2006 at 08:01:21PM +0100, Dick Davies wrote:> > Shouldn''t a ZFS share be permanently enabling NFS?> # svcprop -p application/auto_enable nfs/server > true> This property indicates that regardless of the current state of > nfs/server, if you invoke share(1M) (either manually or through ''zfs > share -a''), then the server will be automatically started.All three (nfs/status, nfs/nlockmgr and nfs/server) have auto_enable, uh, enabled.> By default, the system should have been in this state, with nfs/server > enabled but temporarily disabled. Did you explicity ''svcadm disable > nfs/server'' beforehand?That sounds like something I''d do to be honest, but in this case I wrote down all the steps I''ve taken from the inital install, through the ZFS root setup, etc. in a journal, so I don'' t think so. I have been frobbing settings trying to get a linux client to understand what NFS4 is however, so I may well have toggled this to try to get the client to see the share. So if someone has explicitly switched off NFS, ZFS won''t turn it back on (even if sharenfs=on for a share)? After a reboot, a ''svcs -xv'' showed nfs/server as not running because its dependencies (nfs/status and nfs/lockmgr) weren''t. Enabling those two seemed to fix it. I wondered if maybe ZFS didn''t make sure they were running. I''m happy to attribute this one to incompetence for now.> ZFS certainly could do the equivalent of a ''svcadm enable nfs/server'', > but it shouldn''t need to, nor is it clear that ZFS should do anything > different than if you had placed something into /etc/dfs/dfstab.That''s partly what I was asking - whether ZFS should dictate ''thou must run this service for me'' to the system as a whole or not. Thanks for the explanation. -- Rasputin :: Jack of All Trades - Master of Nuns http://number9.hellooperator.net/