Files
makronix/docs/reference/sharing.txt
T
lotherkandClaude Opus 5.5 44e79e9ce2 mcde: Sharing in System Settings: SSH, SMB, NFS, AFP, AppleTalk
McdeSys gets the services that let others in (mcde_sys_service_state,
mcde_sys_service_set) and one list of shared folders for SMB, NFS and AFP
(mcde_sys_shares, mcde_sys_shares_set: /etc/mcde-shares, and a block
between "# MCDE shares begin" and "... end" in exports, smb.conf and
afp.conf; the rest of each file stays as written).  NetBSD switches
rc.conf and runs the rc.d scripts -- sshd; rpcbind, mountd, nfsd and
nfslocking for NFS; samba, netatalk, atalkd and papd from pkgsrc, whose
example rc.d scripts are copied to /etc/rc.d first, as PKG_RCD_SCRIPTS=YES
would.  Linux uses systemctl (ssh, smbd and nmbd, nfs-server, netatalk;
no AppleTalk).  NetBSD's kernel has AppleTalk (GENERIC: options NETATALK)
and pkgsrc's netatalk4 builds atalkd on NetBSD.  docs/reference/sharing.txt.

The Sharing pane (Internet & Network) shows each service with its switch
and how others reach it (ssh host, smb://host/, host:/folder,
afp://host/), and the shared folders with Add and Remove; as a user it
offers Unlock..., as Accounts does.

Measured: on the Linux host, read only: ssh, smb, nfs installed, enabled,
running; afp and appletalk not installed (the pane on Xvfb says so).  In
the build VM as root: NFS on started rpcbind, mountd, nfsd, statd, lockd;
sharing /tmp/mcdeshare made showmount -e list it for Everyone; NFS off
stopped them; the VM's rc.conf was restored after.  First found there:
mountd will not start without /etc/exports, and statd/lockd are one
script, nfslocking.  Samba and netatalk are not in the makronix set yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 12:36:46 +00:00

163 lines
5.3 KiB
Plaintext

Sharing on NetBSD: what McdeSys mcde_sys_service_* and the shares follow. Collected 2026-11-11.
== src/etc/defaults/rc.conf (the switches)
234:rpcbind=NO rpcbind_flags="-l" # -l logs libwrap
252:sshd=NO sshd_flags=""
310:mountd=NO mountd_flags="" # NFS mount requests daemon
312:nfs_server=NO # enable server daemons
314:lockd=NO lockd_flags=""
315:statd=NO statd_flags=""
== src/etc/rc.d/nfsd, mountd (what nfs_server starts); statd and lockd share src/etc/rc.d/nfslocking; mountd will not start without a readable /etc/exports
7:# REQUIRE: rpcbind mountd
11:name="nfsd"
12:rcvar="nfs_server"
13:command="/usr/sbin/${name}"
19:run_rc_command "$1"
7:# REQUIRE: NETWORKING mountall rpcbind quota
11:name="mountd"
12:rcvar=$name
13:command="/usr/sbin/${name}"
14:required_files="/etc/exports"
16:extra_commands="reload"
23: if [ ! -r /etc/zfs/exports ]; then
24: touch /etc/zfs/exports
26: rc_flags="${rc_flags} /etc/exports /etc/zfs/exports"
== src/usr.sbin/mountd/exports.5:111-135, 209-222, 297-316, 351-375 (a line: path, options, hosts; -ro, -maproot, -network; examples)
.Ql - .
All other items on an export line are interpreted either as netgroups
.Po see
.Xr netgroup 5
.Pc
or as hosts, which can be either names, as in example.com, or numbers,
as in 192.0.2.123 or 2001:db8:1234:abcd::42.
Sets of hosts in a contiguous network range can be specified with the
.Fl network
option.
.Pp
The same filesystem may be exported on multiple lines with different
options to different sets of hosts, as long as it is exported at most
once to each host, netgroup, or network.
.Pp
Export lines with no hosts, netgroups, or
.Fl network
options are exported to
.Em any
hosts on the network, with no access control.
.Pp
Supported export options:
.Pp
.Bl -tag -width Fl -compact
.It Fl alldirs
...
used to authenticate and map client credentials.
.Sy This option is currently not implemented.
.It Fl ro
Export filesystem read-only.
Clients will be forbidden to change or write to anything in the
filesystem
.Po
except for named pipes, sockets, and device nodes, where
write semantics is client-side anyway
.Pc .
.It Fl o
Synonym for
.Fl ro
for compatibility with older export file formats.
...
.Sm off
.It Fl network Li = Ar netname Op Li / Ar prefixlength
.Sm on
Export the filesystem to all hosts in the specified network.
.Pp
This approach to identifying hosts requires less overhead within the
kernel and is recommended for cases where the export line refers to a
large number of clients within an administrative subnet.
.Pp
The netmask may be specified either by
.Ar prefixlength ,
or
.Pq for IPv4 networks only
by using a separate
.Fl mask
option.
If the mask is not specified, it will default to the mask for that network
class
.Po
A, B or C; see
...
.Sh EXAMPLES
.Bd -literal -offset indent
/usr /usr/local -maproot=0:10 friends
/usr -maproot=daemon grumpy.cis.uoguelph.ca 131.104.48.16
/usr -ro -mapall=nobody
/u -maproot=bin: -network 131.104.48 -mask 255.255.255.0
/a -network 192.168.0/24
/a -network 3ffe:1ce1:1:fe80::/64
/u2 -maproot=root friends
/u2 -alldirs -kerb -network cis-net -mask cis-mask
.Ed
.Pp
Given that
.Pa /usr ,
.Pa /u ,
and
.Pa /u2
are local filesystem mount points, the above example specifies the
following:
.Bl -tag -width ".Pa /usr"
.It Pa /usr
is exported to hosts
.Ql friends
where
.Ql friends
== src/sys/arch/amd64/conf/GENERIC:233
options NETATALK # AppleTalk networking protocols
== pkgsrc/net/netatalk4/options.mk (AppleTalk on NetBSD and Linux)
19:PKG_SUPPORTED_OPTIONS+= appletalk
20:PKG_SUGGESTED_OPTIONS+= appletalk
25:PLIST_VARS+= appletalk gssapi ldap pam # spotlight
27:.if !empty(PKG_OPTIONS:Mappletalk)
30:PLIST.appletalk= yes
31:MESON_ARGS+= -Dwith-appletalk=true
35:ATALK_RCD_SCRIPTS= a2boot atalkd macipgw papd timelord
36:RCD_SCRIPTS+= ${ATALK_RCD_SCRIPTS}
37:.for rs in ${ATALK_RCD_SCRIPTS}
41:MESON_ARGS+= -Dwith-appletalk=false
== pkgsrc/net/netatalk4/Makefile RCD_SCRIPTS
22:PKG_SYSCONFSUBDIR= netatalk
26:EGDIR= share/examples/netatalk
27:CONF_FILES+= ${EGDIR}/afp.conf ${PKG_SYSCONFDIR}/afp.conf
28:CONF_FILES+= ${EGDIR}/extmap.conf ${PKG_SYSCONFDIR}/extmap.conf
35:RCD_SCRIPTS= netatalk
135:INSTALLATION_DIRS+= ${EGDIR}
145: ${DESTDIR}${PREFIX}/${EGDIR}/afp.conf
147: ${DESTDIR}${PREFIX}/${EGDIR}/extmap.conf
150: ${DESTDIR}${PREFIX}/${EGDIR}/atalkd.conf
152: ${DESTDIR}${PREFIX}/${EGDIR}/papd.conf
156: ${DESTDIR}${PREFIX}/${EGDIR}/dbus-session.conf
160: ${DESTDIR}${PREFIX}/${EGDIR}/netatalk.pam
== pkgsrc/net/samba4/Makefile RCD_SCRIPTS, config
32:PKG_SYSCONFSUBDIR= samba
142:CONF_FILES= ${PREFIX}/${EGDIR}/smb.conf.default ${SMB_CONFIG}/smb.conf
144:RCD_SCRIPTS+= samba nmbd smbd ${WINBINDD_RCD_SCRIPT}
170:SUBST_FILES.logpath= examples/smb.conf.default
191: ${INSTALL_DATA} ${WRKSRC}/examples/smb.conf.default \
== pkgsrc/mk/pkginstall/bsd.pkginstall.mk:1006-1012, 471 (rc.d scripts: in share/examples/rc.d; copied to /etc/rc.d only with PKG_RCD_SCRIPTS=YES, default NO)
# PKG_RCD_SCRIPTS indicates whether to automatically install rc.d scripts
# to ${RCD_SCRIPTS_DIR}. It is either YES or NO and defaults to
# NO. This variable only takes effect if ${PKG_CONFIG} == "YES".
# Unmodified scripts are removed upon deinstall. Modified scripts
# are left in-place and will not be replaced if the package is
# reinstalled or upgraded.
#
RCD_SCRIPTS_EXAMPLEDIR= share/examples/rc.d