You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you attempt to use the standard NFS port (2049), unfs3 will create a regular BSD style TCP socket and bind it to the specified port. It will then pass that file descriptor to svctcp_create(), part of the RPC suite of functions. On Solaris and illumos systems, that function comes from libnsl.so.1 and appears to require not a BSD socket but a TLI socket, an unfortunate remnant of UNIX history.
Note in the autoconf scripts for unfs3 there is a mention of librpcsoc.so.1, one of the SunOS/UCB compatibility libraries that we don't ship in SmartOS. This library contains an implementation of svctcp_create() which does allow the use of BSD sockets. I believe that the configure script doesn't end up using it for our pkgsrc build because it's not available on the system, but the behaviour you see above is then only visible at runtime.
One way to work around this, though it's not perfect (because it involves the use of dynamic port numbers which confuses at least the Linux NFS client) is to use the -u flag to unfsd. This will use a random port for the NFS and MOUNT services; i.e., it passes RPC_SOCKANY rather than a specific file descriptor, so there is no socket type mismatch.
There are two likely paths forward for this issue:
fix illumos to accept BSD sockets as well as TLI sockets for the RPC functions, though this means unfsd will still be broken until you upgrade to a platform image with this fix
fix unfsd to be able to create and bind a TLI socket instead of a BSD socket, which would mean we can use unfsd even on older illumos systems in advance of this fix
There's a third option, which is probably also not great, which is to create a pkgsrc package with the librpcsoc.so.1 compatibility bits in it and ship it outside the core OS -- but I don't know how hard it would be to extricate it from illumos-gate and build it elsewhere, or if it makes use of private interfaces with the rest of the OS.
This function calls at least svc_xprt_alloc() which does not seem to be documented, and xprt_register(), which does. Some more digging would be required to see how safe it would be to ship a copy of this library in pkgsrc.
I actually tried specifying a udp port but that did not help. This is probably related why some packages no longer build without patching because they can't find rpcgen on newer platforms. (See #126) Maybe it is worth wrapping some of the remove bits up in an optional package somehow.
@sjorge Specifying a port won't help, because from the perspective of the RPC routines the same thing is happening. Whether unfsd attempts to use its specific default (2049), or whether you provide a specific port, in both cases unfsd is binding a BSD style socket and attempting to pass it to the RPC routines, which doesn't work for the reason I described above.
If instead you use the -u flag I mentioned, the software will pass RPC_SOCKANY to get a random port number. From the manual page:
-u Use an unprivileged port for NFS and MOUNT service. Normally,
unfsd will use port number 2049, which is the standard port for
NFS. When this option is in effect, arbitrary ports chosen by
the RPC library will be used. You may need to use this option
when running unfsd from a normal user account.
This is not related to rpcgen -- rather, it's a long-standing issue with unfsd when built against the regular libnsl.so.1 RPC routines. As far as I know, we've never shipped the ancient compatibility librpcsoc.so.1 in the SmartOS platform image so this problem has existed in the unfsd package since we started shipping pkgsrc packages.
Activity
jclulow commentedon Jul 12, 2018
This is an unfortunately complicated problem.
If you attempt to use the standard NFS port (2049), unfs3 will create a regular BSD style TCP socket and bind it to the specified port. It will then pass that file descriptor to
svctcp_create(), part of the RPC suite of functions. On Solaris and illumos systems, that function comes fromlibnsl.so.1and appears to require not a BSD socket but a TLI socket, an unfortunate remnant of UNIX history.Note in the autoconf scripts for unfs3 there is a mention of
librpcsoc.so.1, one of the SunOS/UCB compatibility libraries that we don't ship in SmartOS. This library contains an implementation ofsvctcp_create()which does allow the use of BSD sockets. I believe that theconfigurescript doesn't end up using it for our pkgsrc build because it's not available on the system, but the behaviour you see above is then only visible at runtime.One way to work around this, though it's not perfect (because it involves the use of dynamic port numbers which confuses at least the Linux NFS client) is to use the
-uflag to unfsd. This will use a random port for the NFS and MOUNT services; i.e., it passesRPC_SOCKANYrather than a specific file descriptor, so there is no socket type mismatch.There are two likely paths forward for this issue:
unfsdwill still be broken until you upgrade to a platform image with this fixunfsdto be able to create and bind a TLI socket instead of a BSD socket, which would mean we can useunfsdeven on older illumos systems in advance of this fixThere's a third option, which is probably also not great, which is to create a pkgsrc package with the
librpcsoc.so.1compatibility bits in it and ship it outside the core OS -- but I don't know how hard it would be to extricate it from illumos-gate and build it elsewhere, or if it makes use of private interfaces with the rest of the OS.jclulow commentedon Jul 12, 2018
Note in particular that the compatibility
librpcsoc.so.1contains what appear to be wrappers around the core RPC functionality fromlibnsl.so.1; e.g., see https://github.com/joyent/illumos-joyent/blob/master/usr/src/ucblib/librpcsoc/svc_tcp.c#L87-L168This function calls at least
svc_xprt_alloc()which does not seem to be documented, andxprt_register(), which does. Some more digging would be required to see how safe it would be to ship a copy of this library in pkgsrc.sjorge commentedon Jul 13, 2018
I actually tried specifying a udp port but that did not help. This is probably related why some packages no longer build without patching because they can't find rpcgen on newer platforms. (See #126) Maybe it is worth wrapping some of the remove bits up in an optional package somehow.
jclulow commentedon Jul 13, 2018
@sjorge Specifying a port won't help, because from the perspective of the RPC routines the same thing is happening. Whether
unfsdattempts to use its specific default (2049), or whether you provide a specific port, in both casesunfsdis binding a BSD style socket and attempting to pass it to the RPC routines, which doesn't work for the reason I described above.If instead you use the
-uflag I mentioned, the software will passRPC_SOCKANYto get a random port number. From the manual page:This is not related to
rpcgen-- rather, it's a long-standing issue withunfsdwhen built against the regularlibnsl.so.1RPC routines. As far as I know, we've never shipped the ancient compatibilitylibrpcsoc.so.1in the SmartOS platform image so this problem has existed in theunfsdpackage since we started shipping pkgsrc packages.expat: update to 2.2.6.
mail/ruby-mime-types: update to 3.2.2
gallery-dl: Update net/gallery-dl to 1.6.1
gnutls: Update security/gnutls to 3.6.5
fasttracker2: update to b127
libupnp: Update to 1.8.4.
cups-filters: Update to 1.25.11
libsixel: update to 1.8.5. (security update)
glib-networking: update to 2.64.0.
security/ruby-airbrussh: update to 1.4.0
textproc/ruby-temple: update to 0.8.2
98 remaining items
finance/rex: update to 0.2.6
p5-YAML-Syck: update to 1.45.
py-icalendar: update to 7.0.0.
devel/serie: update to 0.6.1
finance/rex: update to 0.2.6
p5-YAML-Syck: update to 1.45.
p5-XML-LibXML: update to 2.0213.
www/ruby-cgi: update to 0.5.2
Update to 0.41
net/ttl: update to 0.22.0
bgpq4: Add version 1.16
misc/rozi: update to 0.0.29
misc/rozi: update to 0.0.29
Update to 2.6.2
Update to 2.5.0