zfs sharenfs

Discussion related to network/web services such as Apache, BIND Sendmail, etc.

zfs sharenfs

Postby gettons » 07 Mar 2011, 21:19

Hi all,

I am playing with zfs sharenfs and I came across a problem. Unless I put a single host/network, I don't get any export after [CMD=" "]showmount -e[/CMD]
I presume because the syntax is not quite right... What I need to do is to export:

Code: Select all
/media 192.168.3.0/24 192.168.4.3 192.168.4.21


So not just a network, but also some other hosts. Is it possible to do this with zfs feature? What I tried is the following:

Code: Select all
zfs set sharenfs="-network=192.168.3.0,-mask=255.255.255.0,-alldirs,192.168.4.2" stuff/installs


But it doesn't like it.
gettons
Junior Member
 
Posts: 19
Joined: 27 Feb 2011, 01:42

Postby thuglife » 07 Mar 2011, 22:01

You don't need commas. Try the following:

Code: Select all
zfs set sharenfs="-alldirs -network=192.168.3.0/24 192.168.4.2" stuff/installs
User avatar
thuglife
Member
 
Posts: 160
Joined: 02 Jul 2009, 16:37
Location: Athens, Greece

Postby gettons » 07 Mar 2011, 22:48

Didn't work either :-(
gettons
Junior Member
 
Posts: 19
Joined: 27 Feb 2011, 01:42

Postby thuglife » 07 Mar 2011, 23:05

Ok, it doesn't work because it's invalid export syntax.

Code: Select all
zfs set sharenfs="-alldirs -network=192.168.3.0/24" stuff/installs


This works for me, but I don't know how you are going to handle the single host. Nevertheless this has nothing to do with the sharenfs property per se, we need someone with more experience in the syntax.
User avatar
thuglife
Member
 
Posts: 160
Joined: 02 Jul 2009, 16:37
Location: Athens, Greece

Postby ian-nai » 07 Mar 2011, 23:10

Hmm, the man page doesn't list a "=" sign in the network spec. If I understand the sharenfs property, whatever syntax /etc/exports handles should work in [FILE]zfs set sharenfs="..."[/FILE] on a "per line" basis.

man exports wrote: /u2 -maproot=root friends
/u2 -alldirs -network cis-net -mask cis-mask



Looks like in [FILE]/etc/exports[/FILE] you would create two lines. One specifying the range of addresses to export to and another line to specify any singular hosts. Try issuing two, separate [FILE]zfs set sharenfs="..."[/FILE] commands.
ian-nai
Junior Member
 
Posts: 49
Joined: 05 Jan 2011, 00:15

Postby phoenix » 07 Mar 2011, 23:18

sharenfs only works for the "simple" case, as it only holds a single line of text, and thus, only generates a single line in the [file]/etc/zfs/exports[/file] file.

If you want to do anything involving more than 1 line of text in an [man=5]exports[/man] file, then you need to do it manually via [file]/etc/exports[/file]
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
User avatar
phoenix
MFC'd
 
Posts: 3349
Joined: 17 Nov 2008, 05:43
Location: Kamloops, BC, Canada

Postby gettons » 08 Mar 2011, 00:43

phoenix wrote:sharenfs only works for the "simple" case, as it only holds a single line of text, and thus, only generates a single line in the [file]/etc/zfs/exports[/file] file.

If you want to do anything involving more than 1 line of text in an [man=5]exports[/man] file, then you need to do it manually via [file]/etc/exports[/file]


This makes sense.
Unfortunately if you run zfs set .... onlyt the last one would be valid.
gettons
Junior Member
 
Posts: 19
Joined: 27 Feb 2011, 01:42


Return to Web & Network Services

Who is online

Users browsing this forum: No registered users and 0 guests